Docs · integrationEverything here works today

Reading to a verified assertion in under ten minutes.

Every block on this page is executed against the published package by a test in CI. If a method is documented here, it exists in @flashyid/sdk@0.3.1. Roadmap APIs live on the spec.

Path A

Issue authority

You run agents. Mint a grant beneath your own, hand it to an agent, and let it present an assertion elsewhere.

issue.ts
import { FlashyID } from '@flashyid/sdk'

const id = new FlashyID({ apiKey })

const grant = await id.grants.issue({
  to:     'agent:ceo-agent',
  scopes: ['proposal.draft'],
  limits: { spend_max: 5000 },
  expires: '4d'
})

const jws = await id.assertions.sign(grant.id)
Path B · the one every vendor buries

Verify authority

Someone else’s agent is talking to you. You hold no Flashy credential and need none — the key is public.

verify.ts
import { verify } from '@flashyid/sdk'

const r = await verify(jws, {
  jwks: 'https://flashyid.com/.well-known/jwks.json',
  require: { scope: 'payment.execute', spend: 1240 }
})

r.valid   // true
r.chain   // [human, org, agent]
r.root    // 'human:michael-gord'
r.reason  // null | 'expired' | 'revoked' | 'out_of_mandate'

Quickstart · verify a counterparty in four steps

No account, no key, no contact with us. Every step below runs against the public surface.

STEP 01

Install

One package, no account, no key.

npm i @flashyid/sdk
STEP 02

Fetch the key

Public, cacheable for an hour. Cache it — do not fetch per request.

jwks.fetch(JWKS_URL)
STEP 03

Verify

State what you require. A verify with no require clause only checks the signature.

verify(jws, { jwks, require })
STEP 04

Read the chain

On refusal, read r.reason before r.valid — the reason is the part that tells you what to do.

r.root · r.chain · r.reason
Published surface · CI-gated
verify() grants.issue() grants.revoke() assertions.sign() assertions.decode() jwks.fetch() chain.walk()

That list is generated from the package’s type declarations, not maintained by hand. A method removed from the SDK fails this page’s test before it reaches a reader.