Skip to main content

Quicknode SDK Examples

Updated on
May 28, 2026

Overview

These examples show the SDK shape across supported Quicknode products. They assume you already initialized the SDK as qn from the Quick Start.

Admin API

Use the Admin API client to inspect and manage account resources such as endpoints, teams, usage, billing, security, and rate limits.

import { QuicknodeSdk } from "@quicknode/sdk";

const qn = QuicknodeSdk.fromEnv();

const endpoints = await qn.admin.getEndpoints({
limit: 20,
sortBy: "created_at",
sortDirection: "desc",
});

for (const endpoint of endpoints.data) {
console.log(endpoint.id, endpoint.name, endpoint.status);
}

For the full API surface, see the Admin API docs.

Streams

Use the Streams client to list, inspect, create, update, pause, activate, delete, and test Streams. The example below lists Streams, counts enabled Streams, and dry-runs a filter without changing account state.

import { QuicknodeSdk, StreamDataset } from "@quicknode/sdk";

const qn = QuicknodeSdk.fromEnv();

const streams = await qn.streams.listStreams({ limit: 10 });
console.log(`Streams: ${streams.pageInfo.total}`);

const enabled = await qn.streams.getEnabledCount();
console.log(`Enabled Streams: ${enabled.total}`);

const filterFunction = Buffer.from(`
function main(data) {
return data;
}
`).toString("base64");

const result = await qn.streams.testFilter({
network: "ethereum-mainnet",
dataset: StreamDataset.Block,
block: "17811625",
filterFunction,
});

console.log(result.result);

For destination options, supported datasets, and request details, see the Streams REST API docs.

Webhooks

Use the Webhooks client to list webhooks, inspect a webhook, create a webhook from a template, pause or activate delivery, and retrieve enabled counts. The example below is read-only.

import { QuicknodeSdk } from "@quicknode/sdk";

const qn = QuicknodeSdk.fromEnv();

const webhooks = await qn.webhooks.listWebhooks({
limit: 10,
offset: 0,
});

for (const webhook of webhooks.data) {
console.log(webhook.id, webhook.name, webhook.status);
}

const enabled = await qn.webhooks.getEnabledCount();
console.log(`Enabled webhooks: ${enabled.total}`);

For template behavior and destination configuration, see the Webhooks REST API docs.

Key-Value Store

Use the Key-Value Store client for simple persisted state. Sets store one string value per key. Lists store ordered string collections under one key.

import { QuicknodeSdk } from "@quicknode/sdk";

const qn = QuicknodeSdk.fromEnv();

const sets = await qn.kvstore.getSets({ limit: 10 });
console.log(`Sets: ${sets.data.length}`);

if (sets.data.length > 0) {
const set = await qn.kvstore.getSet(sets.data[0].key);
console.log(set.value);
}

const lists = await qn.kvstore.getLists({ limit: 10 });
console.log(`Lists: ${lists.data.keys.length}`);

For all list and set operations, see the Key-Value Store REST API docs.

Agent workflow example

Agents can combine clients in one run. For example, a release automation agent can inspect endpoints, Streams, Webhooks, and Key-Value Store state before deciding what action to take.

import { QuicknodeSdk } from "@quicknode/sdk";

const qn = QuicknodeSdk.fromEnv();

const endpoints = await qn.admin.getEndpoints({ tagLabels: ["sdk-managed"] });
const streams = await qn.streams.listStreams({ limit: 10 });
const webhooks = await qn.webhooks.listWebhooks({ limit: 10 });
const sets = await qn.kvstore.getSets({ limit: 10 });

console.log({
endpoints: endpoints.data.length,
streams: streams.data.length,
webhooks: webhooks.data.length,
sets: sets.data.length,
});
Share this doc