◈ SecuriX
Reference

SDK Reference

Detailed API reference for the SecuriX Node.js SDK.

SDK Reference

SecuriX provides two primary packages for integration: @securix/core (server-side) and @securix/client (UI-side).

@securix/core

The core SDK handles authentication flows and MCP configuration.

Securix.auth.createSession(config)

Initiates a new authentication session for a user.

Parameters:

  • entityId (string, required): A unique identifier for your user.
  • flow (string, optional): Either 'popup' or 'device'. Defaults to 'popup'.
  • providers (object, required): A map of providers and their requested scopes.

Example:

const session = await Securix.auth.createSession({
  entityId: "user_1",
  flow: "device",
  providers: {
    gmail: { scopes: ["https://www.googleapis.com/auth/gmail.readonly"] }
  }
});

Securix.mcp.getUrl(config)

Generates a base64-encoded URL for use with MCP-compliant agents.

Parameters:

  • apiKey (string, required): Your SecuriX API Key.
  • entityId (string, required): The user's unique identifier.
  • agentId (string, required): Agent Id created in Developer Portal.

@securix/client (React/Next.js)

The client SDK provides UI components for the Popup flow.

<SecurixButton />

A drop-in button that handles the entire authentication handshake.

Props:

  • onSuccess: Callback triggered when auth is complete.
  • onError: Callback triggered on failure.
  • providers: List of providers to authenticate.

HTTP Headers

When calling the SecuriX Proxy directly, use these headers:

HeaderDescription
securix-api-keyYour secret API key (Server-side only).
securix-entity-idThe unique ID of the user.
securix-agent-idThe unique ID of the agent.
securix-debug-provider(Optional) Force a specific provider for local testing.

On this page