NodeJS

Talon Auth works with any Node.js HTTP server. This example uses the built-in node:http module to show the full flow with no framework dependencies.

Setup

Install the package:

npm install talon-auth

Create a verifier with your app ID from the Talon dashboard:

import { createVerifier } from 'talon-auth'

const verifier = createVerifier({ appId: '[your-app-id]' })

Verifying requests

Call verifier.verifyHeader() with the Authorization header from the incoming request. It returns the verified user object on success, or throws if the token is missing or invalid:

const { user } = await verifier.verifyHeader(req.headers.authorization)

Example

The example below serves an HTML page that loads the <talon-login> web component, authenticates the user in the browser, then calls a /message endpoint that verifies the JWT and returns a personalized greeting.

node.ts
Subscribe to our NewsletterGet new Feathers content as it becomes available.
Talon Auth logo

Copyright © 2012 - 2026 feathers.dev