Before you begin
Roles & credentials- Organization member credentials for the Sutro API (email and password).
curl,jq,uuidgen, and thejwtCLI.- Node.js (optional) if you prefer the JavaScript example.
- UNIX shell (macOS/Linux) or WSL on Windows.
<ORG_MEMBER_EMAIL>— Email for an organization member.<ORG_MEMBER_PASSWORD>— Password for that account.<COMMON_NAME>— Friendly name for the certificate to generate (e.g., “Staging key”).<JWT_ISSUER>— Issuer string to embed in Builder JWTs (e.g., your org slug or auth issuer).
All placeholders appear in angle brackets and must be replaced before running commands.
Steps
Sutro walks you through each credential step so you stay in charge of the entire security chain—from login to Builder-issued tokens—with Sutro validating every move.1
Authenticate as an organization member
Use your organization member credentials to obtain an access token.
Replace these placeholders
| Placeholder | Meaning |
|---|---|
<ORG_MEMBER_EMAIL> | Email of an organization member with login access |
<ORG_MEMBER_PASSWORD> | Password for that account |
2
Initialize your organization
Provision a certificate and private key for signing Builder JWTs.
Replace these placeholders
| Placeholder | Meaning |
|---|---|
<COMMON_NAME> | Friendly label for the certificate (e.g., “Production key”) |
<JWT_ISSUER> | The value you expect to place in the iss claim of Builder JWTs |
The file sutro.key contains your private key. Store it securely and restrict file permissions.
3
Create a Builder
Create a Builder and record its
sid. You’ll use this value as the JWT subject (sub).Important: The JWTsubmust equal the Builder’ssid.
4
Generate a Builder JWT with the CLI
Use the
jwt CLI to sign a short-lived access token with your private key.Replace or verify these values
| Field | Meaning |
|---|---|
iss | Must match <JWT_ISSUER> you set during initialization |
sub | Must equal the Builder’s sid (${BUILDER_SID}) |
aud | Audience of the Sutro API: https://sapi.withsutro.com |
exp | Expiration time (Unix seconds). The example uses 1 hour. |
5
Generate a Builder JWT in JavaScript (optional)
If you prefer Node.js:
SetBUILDER_SIDandJWT_ISSUERin your environment before running the script.
6
Verify your JWT (optional)
- Inspect claims and signature at https://jwt.io/.
- Your public certificate is in
sutro.crt(PEM).
Your organization keys and Builder JWT flow are locked down—keep building knowing every API call is authenticated and auditable.
Reference
- POST
/login— Exchange organization member credentials for a JWT used to administer your organization. - POST
/initialization— Provision a certificate and private key used to sign Builder JWTs. - POST
/builders— Create a Builder and obtain itssid. - Builder JWT claims —
iss(issuer),sub(Buildersid),aud(https://sapi.withsutro.com),jti,exp.
Next steps
- Build a full-stack app using your Builder JWT
- Review the API Reference for all available endpoints