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.)", }});
Timestamp (in milliseconds) of the request, used to verify liveness of user requests.
string
required
Unique identifier for a given Organization.
object
required
The parameters object containing the specific intent data for this activity.
Show details
object
httpAuthzV1 field
Show details
array
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).
Show item details
Array item type: string
item field
array
SHA-256 digest of each bound header value, as sha-256=:<base64>:. One entry per entry in header_names.
Show item details
Array item type: string
item field
A successful response returns the following fields:
object
required
The activity object containing type, intent, and result
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.)", }});