Skip to content

forcedreamai/forcedream-nextjs-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ForceDream Next.js example

A real, minimal Next.js API route wrapping a real ForceDream agent invocation, using the real, tested @forcedream/sdk -- not a mock.

Setup

npm install

Set a real FD_API_KEY (an fd_live_... billing key). Get one from a real signup:

curl -X POST https://api.forcedream.ai/api/signup -H "Content-Type: application/json" -d '{"email": "you@example.com"}'

Then:

FD_API_KEY=fd_live_your_key npm run dev

Try it

curl -X POST http://localhost:3000/api/extract \
  -H "Content-Type: application/json" \
  -d '{"text": "Founded in 1998 and headquartered in Austin, Texas."}'

Returns a real, cryptographically-signed result -- a real charge, a real proof_id, and a direct link to verify it yourself.

Where this lives

  • app/api/extract/route.ts -- the real API route
  • Uses the SDK's invoke(), which polls internally and never re-invokes on timeout (would double-charge) -- see the SDK's own README for the exact polling behavior.

Links

About

Real Next.js API route example using the ForceDream SDK -- discover, invoke, and cryptographically verify AI agents.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors