Skip to main content
Glama
sign.js627 B
import { FlattenedSign } from '../flattened/sign.js'; export class CompactSign { #flattened; constructor(payload) { this.#flattened = new FlattenedSign(payload); } setProtectedHeader(protectedHeader) { this.#flattened.setProtectedHeader(protectedHeader); return this; } async sign(key, options) { const jws = await this.#flattened.sign(key, options); if (jws.payload === undefined) { throw new TypeError('use the flattened module for creating JWS with b64: false'); } return `${jws.protected}.${jws.payload}.${jws.signature}`; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Valerio357/bet-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server