Skip to main content

Vault | Node.js SDK | JWT Endpoints

JWT Endpoints

JWT Retrieve

jwkGet(request: GetRequest): Promise<PangeaResponse<GetResult>>

Retrieve a key in JWK format.

required parameters

GetRequest

Response Object

Promise<PangeaResponse<GetResult>>
const response = await vault.jwkGet(
  "pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"
);

JWT Sign

jwtSign(id: string, payload: string): Promise<PangeaResponse<SignResult>>

Sign a JSON Web Token (JWT) using a key.

required parameters

string

The item ID

string

The JWT payload (in JSON)

Response Object

Promise<PangeaResponse<SignResult>>
const response = await vault.jwtSign(
  "pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5",
  "{\"sub\": \"1234567890\",\"name\": \"John Doe\",\"admin\": true}"
);

JWT Verify

jwtVerify(jws: string): Promise<PangeaResponse<VerifyResult>>

Verify the signature of a JSON Web Token (JWT).

required parameters

string

The signed JSON Web Token (JWS)

Response Object

Promise<PangeaResponse<VerifyResult>>
const response = await vault.jwtVerify(
  "ewogICJhbGciO..."
);