Browse the library
182 production-ready snippets across 6 languages.
PROVIDERS
LANGUAGES
182 snippets
MongoDB
TypeScript
Insert a Document
Insert a document into a MongoDB collection using the official driver.
const result = await collection.insertOne(newCustomer);
$19 · Pro
View →
MongoDB
TypeScript
Update a Document
Update a document in a MongoDB collection using the official driver.
const result = await subscribers.updateOne(filter, update);
$19 · Pro
View →
MongoDB
TypeScript
Query Documents
Query documents from a MongoDB collection with a filter using the official driver.
const cursor = orders.find(filter).sort({ createdAt: -1 }).limit(20);
$19 · Pro
View →
Firebase
TypeScript
Verify ID Token
Verify a Firebase Auth ID token on the backend.
const decodedToken = await getAuth().verifyIdToken(idToken);
$19 · Pro
View →
Notion
TypeScript
Query a Database
Query pages from a Notion database with a filter.
const response = await notion.dataSources.query({
$19 · Pro
View →
Discord
TypeScript
Slash Command Handler
Handle an incoming Discord slash command interaction.
if (interaction.type === InteractionType.APPLICATION_COMMAND) {
$19 · Pro
View →
Notion
TypeScript
Update Page Properties
Update a page's property values.
const updatedPage = await notion.pages.update({
$19 · Pro
View →
Firebase
TypeScript
Firestore: Query a Collection
Query documents from a Firestore collection with a filter.
.where("status", "==", "active")
$19 · Pro
View →
Notion
TypeScript
Create a Page
Create a new page in a Notion database.
const newTask = await notion.pages.create({
$19 · Pro
View →
Cloudflare
TypeScript
Workers KV: Read and Write
Read and write a key-value pair in Workers KV.
const storedValue = await writeAndReadKvValue("session:9f3a-user-locale", "en-US");
$19 · Pro
View →
Firebase
TypeScript
Firestore: Add a Document
Add a document to a Firestore collection.
const docRef = await customersRef.add({
$19 · Pro
View →
Discord
TypeScript
Verify Interaction Signature
Verify a Discord interaction request's Ed25519 signature.
const isVerified = nacl.sign.detached.verify(Buffer.from(timestamp + rawBody), Buffer.from(signature, "hex"), Buffer.from(DISCORD_PUBLIC_KEY, "hex"));
$19 · Pro
View →
Browse 1003+ API Integration Snippets | apiexamples