Integrations and API
Connect scripts, editor plugins, browser extensions or your own apps. A client needs two separate secrets:
| Secret | What it unlocks | Where it comes from |
|---|---|---|
API token (nf_…) |
Talking to the API: fetching and storing encrypted notes | NoteFlare → Account → Integrations |
| Passphrase | Reading and writing note content | You. It never leaves the client |
A token on its own exposes nothing readable.
Create a token
Section titled “Create a token”Under Account → Integrations, create a token. It is shown once.
| Scope | Can | Can’t |
|---|---|---|
read |
Read the vault, list and fetch notes | Create, change or delete anything |
write |
Everything read can, plus create, update, trash, restore and delete notes |
Manage tokens or change the passphrase |
Tokens can expire after 30 days, 90 days or a year, and can be revoked at any time.
TypeScript SDK
Section titled “TypeScript SDK”import { NoteFlareClient } from '@noteflare/client'
const nf = new NoteFlareClient({ url: 'https://notes.example.com', token: 'nf_…' })await nf.unlock(passphrase) // decryption stays on your sideawait nf.create({ title: 'From my script', body: '- [ ] it works' })export NOTEFLARE_URL=https://notes.example.comexport NOTEFLARE_TOKEN=nf_… # a write tokennode packages/cli/bin/noteflare.mjs lsecho "- [ ] Pack a jacket" | node packages/cli/bin/noteflare.mjs append tripnode packages/cli/bin/noteflare.mjs export ./backup # Markdown you can re-importThe CLI asks for the passphrase, or reads NOTEFLARE_PASSPHRASE.
Let API clients through Cloudflare Access
Section titled “Let API clients through Cloudflare Access”Access protects the whole domain with a browser login, which a script can’t complete. Pick one of these for the /api/v1 path.
Option A: Bypass (simplest). Every /api/v1 request must still carry a NoteFlare token.
- In Zero Trust → Access → Applications, add a Self-hosted application.
- Domain: your NoteFlare domain. Path:
api/v1. - Policy: action Bypass, include Everyone.
Option B: Service Auth (defence in depth). Requests need a Cloudflare Access service token and a NoteFlare token.
- Zero Trust → Access → Service Auth → Create service token. Copy the Client ID and Secret.
- Add a Self-hosted application for path
api/v1with a Service Auth policy that includes that service token. - Send
CF-Access-Client-IdandCF-Access-Client-Secreton every request.
Full reference
Section titled “Full reference”The OpenAPI 3.1 description is served by your own deployment at /api/v1/openapi.json.