SDKs
Official HelloJohn SDKs for React, JavaScript, Next.js, Node.js, Go, and Python — with TypeScript support throughout.
SDKs
HelloJohn provides official SDKs for the most common languages and frameworks. All SDKs are open source, typed, and follow the same design principles: sensible defaults, minimal configuration, and full flexibility when you need it.
Available SDKs
| SDK | Package | Use case |
|---|---|---|
| React | @hellojohn/react | React apps (hooks + components) |
| JavaScript | @hellojohn/js | Vanilla JS, Vue, Svelte, Angular |
| Next.js | @hellojohn/nextjs | Next.js App Router + Pages Router |
| Node.js | @hellojohn/node | Backend services, admin operations |
| Go | github.com/hellojohn/hellojohn-go | Go servers and services |
| Python | hellojohn | Python backends (FastAPI, Django, Flask) |
Client vs. server SDKs
HelloJohn SDKs come in two flavors:
Client SDKs (React, JS, Next.js client components):
- Run in the browser
- Use the publishable key (
pk_...) - Handle sign-in, sign-up, session management, MFA
- Cannot access admin operations
Server SDKs (Node.js, Go, Python, Next.js server):
- Run on your backend
- Use the secret key (
sk_...) - Can manage users, tenants, sessions
- Never expose the secret key to browsers
// ✅ Client: use publishable key
const hj = createHelloJohnClient({ publishableKey: 'pk_live_...' });
// ✅ Server: use secret key
const hj = createHelloJohnAdminClient({ secretKey: process.env.HJ_SECRET_KEY });Key types
| Key | Prefix | Where used | Capabilities |
|---|---|---|---|
| Publishable key | pk_live_ or pk_test_ | Client-side code | Auth flows only |
| Secret key | sk_live_ or sk_test_ | Server-side only | Full admin API |
Find your keys in the HelloJohn dashboard under Settings → API Keys.
Common patterns
Verify a JWT in your backend
Every server SDK provides a verifyToken helper:
// Node.js
import { verifyToken } from '@hellojohn/node';
const payload = await verifyToken(accessToken, {
secretKey: process.env.HJ_SECRET_KEY,
});
// payload.sub — user ID
// payload.tenant_id — tenant
// payload.role — user's role// Go
payload, err := hj.VerifyToken(ctx, accessToken)
if err != nil {
http.Error(w, "Unauthorized", http.StatusUnauthorized)
return
}# Python
payload = hj.verify_token(access_token)Protect a route
// Next.js middleware
import { withHelloJohnAuth } from '@hellojohn/nextjs/server';
export default withHelloJohnAuth(async (req) => {
const user = req.auth.user;
// ...
});// Go middleware
func AuthMiddleware(hj *hellojohn.Client) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
token := r.Header.Get("Authorization")
payload, err := hj.VerifyToken(r.Context(), strings.TrimPrefix(token, "Bearer "))
if err != nil {
http.Error(w, "Unauthorized", 401)
return
}
ctx := context.WithValue(r.Context(), "user", payload)
next.ServeHTTP(w, r.WithContext(ctx))
})
}
}SDK versioning
All SDKs follow Semantic Versioning. SDK minor and patch versions are compatible with the same HelloJohn server version range:
| SDK version | Compatible server versions |
|---|---|
| 1.x.x | HelloJohn 1.x.x |
| 2.x.x | HelloJohn 2.x.x |
Community SDKs
Community-maintained SDKs (not officially supported):
- Ruby — github.com/hellojohn-community/hellojohn-ruby
- PHP — github.com/hellojohn-community/hellojohn-php
- Java — github.com/hellojohn-community/hellojohn-java
- Rust — github.com/hellojohn-community/hellojohn-rs
Want to build an SDK for another language? See our SDK Development Guide.
Getting help
- GitHub Issues — Bug reports and feature requests
- Discord — Community support
- support@hellojohn.dev — Enterprise support