-
Notifications
You must be signed in to change notification settings - Fork 0
Examples Deno Bun
Doug Fennell edited this page Sep 22, 2025
·
1 revision
// Deno can import npm packages via the npm: prefix
import { createJwksFetcher } from 'npm:@rdcp.dev/server'
const fetcher = createJwksFetcher({ ttlMs: 30_000 })
async function fetchWithBackoff(baseUrl: string, attempts = 3) {
let lastErr: unknown
for (let i = 0; i < attempts; i++) {
try {
const res = await fetcher.fetch(baseUrl)
console.log('jwks keys', res.jwks.keys.length, 'fromCache', res.fromCache)
return res
} catch (e) {
lastErr = e
await new Promise(r => setTimeout(r, Math.min(2000, 250 * (1 << i))))
}
}
throw lastErr
}
await fetchWithBackoff(Deno.env.get('BASE_URL') ?? 'http://localhost:3000')
import { createJwksFetcher } from '@rdcp.dev/server'
const fetcher = createJwksFetcher({ ttlMs: 30_000 })
async function main() {
const baseUrl = process.env.BASE_URL ?? 'http://localhost:3000'
const res = await fetcher.fetch(baseUrl)
console.log('jwks keys', res.jwks.keys.length, 'fromCache', res.fromCache)
}
main().catch(err => {
console.error('JWKS fetch failed', err)
process.exit(1)
})
Getting Started: Installation β’ Basic Usage β’ Authentication
Migration: From Manual Implementation β’ Framework Examples β’ Publishing Guide
Protocol: RDCP v1.0 Specification β’ Implementation Guide β’ API Reference
π Home | π¦ NPM Package | π GitHub | π Issues
RDCP SDK v1.0.0 - Runtime Debug Control Protocol implementation for JavaScript/Node.js applications
- Implementation-Status
- JavaScript-vs-TypeScript-Boundaries
- Core-Package-Boundaries
- Publishing-Setup
- Contributing
- API-Reference
- Protocol Specification
- Implementation Guide
- RDCP-Primitive-Types
- Protocol-Schemas
- Protocol-Error-Codes
- API-Reference
Version: 1.0.0
Protocol: RDCP v1.0
License: Apache-2.0