First-party app
Memberstack

Memberstack

Manage Memberstack members and free-plan connections, verify member tokens, and read and write Data Table records through the Memberstack Admin REST API.

stable Security & IdentityCommerce & PaymentsDatabases

About

Memberstack ships in the w6w first-party pack. It declares 15 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.

App id
io.w6w.memberstack
Version
0.1.0
Author
w6w
Licence
MIT
Categories
Security & Identity · Commerce & Payments · Databases

Overview

Memberstack adds sign-up, login, gated content and Stripe-backed plans to a site without a backend of its own. This app drives its server-side Admin REST API: the calls a backend, a no-code automation or a migration script makes on a member’s behalf with a secret key.

It lists, fetches, creates, updates and deletes members (looked up by id or by email), adds and removes free plans, and verifies the JWT a member’s browser presents so a workflow can trust who is calling. It also covers Data Tables, Memberstack’s structured record store: list the tables, read a table’s schema, and create, query, update and delete records, optionally owned by a member.

The secret key is a live key (sk_) or a sandbox key (sk_sb_); the key itself decides which environment every call touches. The front-end DOM SDK, webhooks and paid-plan checkout are not part of the Admin REST API and are not covered.

Build with Memberstack

Three routes to the same 15 actions. The Workflow tab is generated from Memberstack's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.

Create Data Record

data-record-create

Create a record in a Data Table, optionally owned by a member.

Delete Data Record

data-record-delete

Permanently delete a Data Table record. Cannot be undone.

Get Data Record

data-record-get

Fetch one record by id (query findUnique), optionally with related records.

Query Data Records

data-record-query

Filter, sort and page through a Data Table's records (Prisma-style findMany).

Update Data Record

data-record-update

Update fields on a Data Table record. Only the fields sent change.

Get Data Table

data-table-get

Fetch one Data Table's schema and access rules.

List Data Tables

data-table-list

List all Data Tables with their fields and access rules.

Add Free Plan to Member

member-add-plan

Add a free plan to a member. Paid plans are not supported.

Create Member

member-create

Create a member, optionally on free plans and with custom fields.

Delete Member

member-delete

Permanently delete a member. Cannot be undone.

Get Member

member-get

Fetch one member by id or email. A missing member returns found: false.

List Members

member-list

List members, 100 per page at most, with cursor pagination.

Remove Free Plan from Member

member-remove-plan

Remove a free plan from a member. Revokes access immediately.

Update Member

member-update

Update a member. customFields and metaData merge; json is replaced wholesale.

Verify Member Token

member-verify-token

Verify a member's JWT and return its decoded payload, or valid: false.

A workflow step names the app and the action, and the editor fills in the connection when you pick one. This is the Step shape from the workflow spec, carrying Memberstack's real ids.

{
  "manifestVersion": "2",
  "name": "memberstack-example",
  "steps": [
    {
      "id": "data-record-create",
      "uses": {
        "app": "io.w6w.memberstack",
        "action": "data-record-create",
        "connection": "conn_YOUR_CONNECTION_ID"
      },
      "with": {
        "tableKey": "<tableKey>",
        "data": "<data>"
      }
    }
  ]
}

Here are some of the things you can do

  • Create Data Record

    perform
    data-record-create
  • Get Data Record

    read
    data-record-get
  • Query Data Records

    search
    data-record-query
  • Update Data Record

    perform
    data-record-update
  • Get Data Table

    read
    data-table-get

+10 more actions available

Every app-specific value here is a blank you have to fill in. An app action is reached through the connection that authenticates it, so the address is a connection id, not the app id — and connections belong to your account, so a public page cannot know yours. Create one for Memberstack, then fill in the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the parameters that action declares. The call itself is real — the shape is transcribed from the studio's own snippet builder, which prints the same kind of blanks — but nothing in it is specific to Memberstack. The Workflow tab is where this app's real ids are.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { W6wClient, isActionRun } from "@w6w/sdk";

// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();

const envelope = await client.run({
  urn: "conn_YOUR_CONNECTION_ID",
  action: "data-record-create",
  payload: {
    tableKey: "<value>",
    data: "<value>",
    // memberId: "<value>",
  },
});

if (isActionRun(envelope)) console.log(envelope.value);
Install the CLI
npm install -g @w6w/cli
CLI
w6w run conn_YOUR_CONNECTION_ID --action data-record-create --payload '{"tableKey":"<value>","data":"<value>"}'

Give an AI agent Memberstack — without giving it Memberstack's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.

One tool call
{
  "name": "w6w_invoke",
  "arguments": {
    "ref": "app:io.w6w.memberstack#data-record-create",
    "input": {
      "tableKey": "<tableKey>",
      "data": "<data>"
    }
  }
}

Every tool names its target with a single ref. The app: form above doesn't name a connection at all — the host resolves which of the caller's Memberstack connections to sign with, and refuses rather than guesses when the answer is ambiguous.

What the agent gets

Credentials it can't read

The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.

A tool surface scoped to the caller

Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.

A durable workflow in one call

Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.

Health-aware discovery

Memberstack's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.

The MCP surface is part of the hosted platform. Memberstack itself is MIT, and the runtime that executes it is source-available (FSL).

Request MCP access

Health checks

Memberstack declares its own checks, so its health is a property of the app rather than something the host guesses at.

service

Memberstack platform status

Status of the Admin API monitor on status.memberstack.com, with the other monitors (Client API, Dashboard API, SSO, Stripe Sync, …) reported as components.

quota

Request headroom