import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().mintJwt({ profile: "<JWT_PROFILE_HTTP_AUTHZ_V1>" // profile field, audience: "<string> (Origin of the receiving service, as `https://<lowercase host>[:port]` with no default port, path, query, or fragment. At most 256 characters. Becomes the `aud` claim.)", httpAuthzV1: { // httpAuthzV1 field, method: "<string> (HTTP method of the bound request. One of `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, or `DELETE`.)", path: "<string> (Path of the bound request, starting with `/`.)", query: "<string> (Query of the bound request without the leading `?`, or empty for no query.)", headerNames: ["<string>"] // Lowercase names of the bound request headers, in order. At most 32 unique names of at most 64 characters each. Cannot include `authorization` or hop-by-hop headers (`proxy-authorization`, `connection`, `keep-alive`, `proxy-connection`, `te`, `transfer-encoding`, `upgrade`)., headerDigest: ["<string>"] // SHA-256 digest of each bound header value, as `sha-256=:<base64>:`. One entry per entry in `header_names`., bodyDigest: "<string> (SHA-256 digest of the bound request body, as `sha-256=:<base64>:`. For a request with no body, the digest of empty content.)", subject: "<string> (ID of a user in the organization, as a lowercase UUID. Becomes the `sub` claim.)", timeToLiveSeconds: "<string> (Lifetime of the JWT in seconds, from 1 to 300. `exp` is `issued_at + time_to_live_seconds`.)", issuedAt: "<string> (Unix time in seconds. Becomes the `iat` claim.)", }});
import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().mintJwt({ profile: "<JWT_PROFILE_HTTP_AUTHZ_V1>" // profile field, audience: "<string> (Origin of the receiving service, as `https://<lowercase host>[:port]` with no default port, path, query, or fragment. At most 256 characters. Becomes the `aud` claim.)", httpAuthzV1: { // httpAuthzV1 field, method: "<string> (HTTP method of the bound request. One of `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, or `DELETE`.)", path: "<string> (Path of the bound request, starting with `/`.)", query: "<string> (Query of the bound request without the leading `?`, or empty for no query.)", headerNames: ["<string>"] // Lowercase names of the bound request headers, in order. At most 32 unique names of at most 64 characters each. Cannot include `authorization` or hop-by-hop headers (`proxy-authorization`, `connection`, `keep-alive`, `proxy-connection`, `te`, `transfer-encoding`, `upgrade`)., headerDigest: ["<string>"] // SHA-256 digest of each bound header value, as `sha-256=:<base64>:`. One entry per entry in `header_names`., bodyDigest: "<string> (SHA-256 digest of the bound request body, as `sha-256=:<base64>:`. For a request with no body, the digest of empty content.)", subject: "<string> (ID of a user in the organization, as a lowercase UUID. Becomes the `sub` claim.)", timeToLiveSeconds: "<string> (Lifetime of the JWT in seconds, from 1 to 300. `exp` is `issued_at + time_to_live_seconds`.)", issuedAt: "<string> (Unix time in seconds. Becomes the `iat` claim.)", }});
Lowercase names of the bound request headers, in order. At most 32 unique names of at most 64 characters each. Cannot include authorization or hop-by-hop headers (proxy-authorization, connection, keep-alive, proxy-connection, te, transfer-encoding, upgrade).
import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().mintJwt({ profile: "<JWT_PROFILE_HTTP_AUTHZ_V1>" // profile field, audience: "<string> (Origin of the receiving service, as `https://<lowercase host>[:port]` with no default port, path, query, or fragment. At most 256 characters. Becomes the `aud` claim.)", httpAuthzV1: { // httpAuthzV1 field, method: "<string> (HTTP method of the bound request. One of `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, or `DELETE`.)", path: "<string> (Path of the bound request, starting with `/`.)", query: "<string> (Query of the bound request without the leading `?`, or empty for no query.)", headerNames: ["<string>"] // Lowercase names of the bound request headers, in order. At most 32 unique names of at most 64 characters each. Cannot include `authorization` or hop-by-hop headers (`proxy-authorization`, `connection`, `keep-alive`, `proxy-connection`, `te`, `transfer-encoding`, `upgrade`)., headerDigest: ["<string>"] // SHA-256 digest of each bound header value, as `sha-256=:<base64>:`. One entry per entry in `header_names`., bodyDigest: "<string> (SHA-256 digest of the bound request body, as `sha-256=:<base64>:`. For a request with no body, the digest of empty content.)", subject: "<string> (ID of a user in the organization, as a lowercase UUID. Becomes the `sub` claim.)", timeToLiveSeconds: "<string> (Lifetime of the JWT in seconds, from 1 to 300. `exp` is `issued_at + time_to_live_seconds`.)", issuedAt: "<string> (Unix time in seconds. Becomes the `iat` claim.)", }});