Agent skill

Better Auth Integration

by hashgraph-online in hashgraph-online/awesome-codex-plugins

Dodo Payments plugin for Better Auth (@dodopayments/better-auth) covering customer sync on signup, authenticated checkout, customer portal, usage ingestion, and verified webhooks.

Apache-2.0Auto-check passedBackend & APIs

Install Better Auth Integration

skills CLI
$ npx skills add hashgraph-online/awesome-codex-plugins --skill better-auth-integration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hashgraph-online/awesome-codex-plugins better-auth-integration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hashgraph-online/awesome-codex-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dodopayments/dodo-agent-plugin/skills/better-auth-integration .claude/skills/better-auth-integration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
better-auth-integration
GitHub stars
1.3k
Token cost
~2.1k tokens
SKILL.md length
524 words
Files
1
Skills in repo
714
Repo updated
First seen
Licence
Apache-2.0

At a glance

Dodo Payments plugin for Better Auth (@dodopayments/better-auth) covering customer sync on signup, authenticated checkout, customer portal, usage ingestion, and verified webhooks.

  • An app uses Better Auth and needs the dodopayments
  • SKILL.md covers When to use this skill, Install, Server setup and Browser client setup, plus 8 more sections
  • Calls npx and npm; needs DODO_PAYMENTS_API_KEY and DODO_PAYMENTS_WEBHOOK_KEY
  • DodopaymentsClient

What it does

Better Auth Integration is an agent skill from hashgraph-online/awesome-codex-plugins. Dodo Payments plugin for Better Auth (@dodopayments/better-auth) covering customer sync on signup, authenticated checkout, customer portal, usage ingestion, and verified webhooks. Use when an app uses Better Auth and needs the dodopayments, dodopaymentsClient, checkout, portal, usage, or webhooks plugins; for other auth stacks use framework-adapters.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Webhooks. It works with Better Auth. The repository describes itself as: A curated list of awesome OpenAI Codex / ChatGPT plugins, skills, and resources. The 1 Codex Marketplace. See live plugins at: https://hol.org/plugins/best-codex-plugins. The licence is Apache-2.0.

When your agent uses it

  • An app uses Better Auth and needs the dodopayments
  • DodopaymentsClient
  • Webhooks plugins
  • For other auth stacks use framework-adapters

Example prompts

  • “/better-auth-integration”

Requirements

  • Node.js
  • A credential in DODO_PAYMENTS_API_KEY
  • A credential in DODO_PAYMENTS_WEBHOOK_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 9e7b281. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • better-auth.com
    • docs.dodopayments.com
    • npmjs.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • DODO_PAYMENTS_API_KEY
    • DODO_PAYMENTS_WEBHOOK_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Better Auth Integration loads about 2.1k tokens when it runs. Until then it costs about 94 tokens; SKILL.md has 524 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~94
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hashgraph-online/awesome-codex-plugins at commit 9e7b281, republished under its Apache-2.0 licence (© hashgraph-online). 524 words, ~2,072 tokens.

Download SKILL.mdSave it as .claude/skills/better-auth-integration/SKILL.md (or your agent's skills folder).
name
better-auth-integration
description
Dodo Payments plugin for Better Auth (@dodopayments/better-auth) covering customer sync on signup, authenticated checkout, customer portal, usage ingestion, and verified webhooks. Use when an app uses Better Auth and needs the dodopayments, dodopaymentsClient, checkout, portal, usage, or webhooks plugins; for other auth stacks use framework-adapters.

Better Auth Integration

Use @dodopayments/better-auth to synchronize Better Auth users with Dodo Payments and expose authenticated checkout, customer portal, subscription, payment, usage, and webhook endpoints.

When to use this skill

  • Create a Dodo customer automatically when a Better Auth user signs up.
  • Start checkout for a signed-in user without exposing a Dodo API key.
  • Let users open their customer portal or list their subscriptions and payments.
  • Submit metered usage for the signed-in customer.
  • Receive signature-verified Dodo webhooks through Better Auth.

Install

bash
npm install @dodopayments/better-auth dodopayments better-auth zod

Requires Better Auth 1.4 or a later 1.x release.

The package exports the lowercase server functions dodopayments, checkout, portal, usage, and webhooks. Its client entry point exports dodopaymentsClient.

Server setup

Every endpoint is registered by a feature in use. Include every feature that the application calls; omitting one makes its route return 404.

typescript
import { betterAuth } from "better-auth";
import DodoPayments from "dodopayments";
import { checkout, dodopayments, portal, usage, webhooks } from "@dodopayments/better-auth";

const dodoPayments = new DodoPayments({
  bearerToken: process.env.DODO_PAYMENTS_API_KEY,
  environment: "test_mode",
});

export const auth = betterAuth({
  database: {
    // your database config
  },
  plugins: [
    dodopayments({
      client: dodoPayments,
      createCustomerOnSignUp: true,
      // `user` here is Better Auth's base user: id, name, email, emailVerified,
      // image, createdAt, updatedAt. Anything else (phone number, company, plan)
      // must first be declared via `user.additionalFields` in your Better Auth
      // config, otherwise it does not exist on the type and will be undefined.
      getCustomerParams: (user) => ({
        metadata: { better_auth_user_id: user.id },
      }),
      use: [
        checkout({
          products: [
            { productId: "pdt_premium", slug: "premium-plan" },
          ],
          successUrl: "https://app.example.com/billing/success",
          authenticatedUsersOnly: true,
        }),
        portal(),
        usage(),
        webhooks({
          webhookKey: process.env.DODO_PAYMENTS_WEBHOOK_KEY,
          onPayload: async (payload) => {
            console.log("Verified Dodo webhook:", payload.type);
          },
        }),
      ],
    }),
  ],
});

products maps an application slug to a Dodo product ID. authenticatedUsersOnly: true requires a Better Auth session for checkout. getCustomerParams adds application metadata when customer synchronization runs.

The plugin adds a dodoCustomerId field to the Better Auth user table. After adding the plugin, update your database schema with the Better Auth CLI:

bash
npx auth generate   # generate the ORM schema or SQL migration, then apply it yourself
npx auth migrate    # or apply it directly (built-in Kysely adapter only)

Browser client setup

typescript
import { createAuthClient } from "better-auth/react";
import { dodopaymentsClient } from "@dodopayments/better-auth/client";

export const authClient = createAuthClient({
  plugins: [dodopaymentsClient()],
});

These are browser methods. They send the Better Auth session cookie automatically; do not pass request.headers to them.

Create a checkout session

typescript
import { authClient } from "@/lib/auth-client";

async function startCheckout() {
  const { data: session, error } = await authClient.dodopayments.checkoutSession({
    slug: "premium-plan",
    referenceId: "order_123",
  });

  if (error) {
    console.error("Checkout error:", error);
    return;
  }

  if (session) {
    window.location.href = session.url;
  }
}

slug must match a product configured in checkout({ products: [...] }). referenceId is optional reconciliation metadata.

Open the customer portal

typescript
const { data: portalSession, error } =
  await authClient.dodopayments.customer.portal();

if (error) {
  console.error("Portal error:", error);
} else if (portalSession?.redirect) {
  window.location.href = portalSession.url;
}

The portal endpoint requires a signed-in, verified user and resolves that user's synchronized Dodo customer.

List subscriptions and payments

typescript
const { data: subscriptions, error: subscriptionsError } =
  await authClient.dodopayments.customer.subscriptions.list({
    query: { page: 1, limit: 10, status: "active" },
  });

const { data: payments, error: paymentsError } =
  await authClient.dodopayments.customer.payments.list({
    query: { page: 1, limit: 10, status: "succeeded" },
  });

if (subscriptionsError || paymentsError) {
  console.error("Could not load billing history");
} else {
  console.log("Subscriptions:", subscriptions?.items);
  console.log("Payments:", payments?.items);
}

Both list responses use an items envelope. Subscription filters accept page, limit, and status; payment filters use the same pagination fields and payment statuses.

Ingest metered usage

Enable usage() on the server, then submit an event for the signed-in customer:

typescript
const { data, error } = await authClient.dodopayments.usage.ingest({
  event_id: "evt_usage_123",
  event_name: "api_calls",
  metadata: { requests: 100 },
  timestamp: new Date(),
});

if (error) {
  console.error("Usage ingestion failed:", error);
} else {
  console.log("Ingested events:", data?.ingested_count);
}

Both usage.ingest and usage.meters.list require a signed-in user with a verified email address. The plugin derives customer_id from the authenticated session. event_id is the event's idempotency key; reuse it when retrying the same event.

Show full SKILL.md (202 more words)Show less

Webhook endpoint

webhooks({ webhookKey, onPayload }) verifies and handles the request itself. With Better Auth's default /api/auth base path, configure this URL in the Dodo dashboard:

text
https://app.example.com/api/auth/dodopayments/webhooks

Do not create a second route and do not call auth.api.dodopayments.verifyWebhook(); that method does not exist. The plugin reads the raw request, verifies the Standard Webhooks signature with webhookKey, and invokes onPayload plus any configured event-specific callback.

Registered endpoints

  • POST /dodopayments/checkout
  • POST /dodopayments/checkout-session
  • GET /dodopayments/customer/portal
  • GET /dodopayments/customer/subscriptions/list
  • GET /dodopayments/customer/payments/list
  • POST /dodopayments/usage/ingest
  • GET /dodopayments/usage/meters/list
  • POST /dodopayments/webhooks

Better Auth prefixes these plugin paths with its configured API base path.

Common mistakes

Enabling only portal(). Checkout, usage, and webhook routes do not exist unless checkout(), usage(), and webhooks() are also present in use.

Mixing browser and server APIs. Call authClient.dodopayments... in browser code without a headers option. Use Better Auth's server API separately when handling server requests.

Creating duplicate customers. When createCustomerOnSignUp is enabled, do not also call client.customers.create() for the same user.

Granting access from browser state. Treat verified webhook events or a server-side Dodo lookup as the source of truth for entitlements.

Adding a custom webhook verifier. The plugin owns /dodopayments/webhooks, signature verification, and callback dispatch.

Resources

© hashgraph-online, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/dodopayments/dodo-agent-plugin/skills/better-auth-integration of hashgraph-online/awesome-codex-plugins.

Open the folder on GitHubat commit 9e7b281

Compare with similar skills

Better Auth Integration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Better Auth Integration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Better Auth Integration this skillhashgraph-online/awesome-codex-plugins1.3k—~2.1kAutomated safety check: PassApache-2.0
Workosusenotra/notra256—~6.2kAutomated safety check: PassAGPL-3.0
Better Auth Best Practiceslatitude-dev/latitude-llm4.7k7 repos~1.6kAutomated safety check: PassMIT
Novu Design Workflownovuhq/novu40k—~2.6kAutomated safety check: PassCustom licence
Golivemikehasa/golive-skill1.2k—~13kAutomated safety check: NotesMIT
Stripe Appsfossasia/eventyay1.7k1 repos~3.6kAutomated safety check: PassApache-2.0

Similar skills

  • Workos

    usenotra/notra

    A skill your agent uses when the user asks for a WorkOS docs URL, term, or dashboard field (Sign-in endpoint, initiateloginuri, Redirect URI, WORKOS env vars), or is implementing, debugging, or…

    256 GitHub stars~6.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Better Auth Best Practices

    latitude-dev/latitude-llm

    Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables.

    4.7k GitHub starsUsed in 7 repos~1.6k tokens
    Backend & APIsAuto-check passed
  • Design notification workflows the Novu way — choose channels, set severity, decide when a workflow is critical, configure digests, and route based on subscriber state.

    40k GitHub stars~2.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Golive

    mikehasa/golive-skill

    Take an agent-written app from repo to live production on the user's OWN accounts, with providers they choose (hosting, database, auth, payments, email, domain/DNS).

    1.2k GitHub stars~13k tokensUpdated 6 days ago
    Backend & APIsAuto-check: notes
  • Stripe Apps

    fossasia/eventyay

    A skill your agent uses when building, modifying, or reviewing a Stripe App — or when the user describes something that implies one (e.g.

    1.7k GitHub starsUsed in 1 repo~3.6k tokens
    Backend & APIsAuto-check passed
  • Dingtalk Message

    agentscope-ai/ReMe

    钉钉消息发送技能。支持企业内部机器人(批量单聊/群聊)和 Webhook 自定义机器人两种接入方式,支持多机器人管理,支持文本、Markdown、链接、ActionCard、FeedCard等多种消息类型。

    3.6k GitHub stars~1.6k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed

More from hashgraph-online/awesome-codex-plugins

All 714 skills in this repo
  • Anime Reaction Gif

    hashgraph-online/awesome-codex-plugins

    Create original anime-style reaction stickers as looping GIFs and MP4 previews, using generated character pose sheets and timed key poses.

    1.3k GitHub stars~922 tokensUpdated yesterday
    Auto-check passed
  • Calibredb

    hashgraph-online/awesome-codex-plugins

    Manage and query Calibre libraries with the calibredb CLI (local paths or Calibre Content server URLs).

    1.3k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Rust API Test Harness

    hashgraph-online/awesome-codex-plugins

    A skill your agent uses when adding, changing, testing, or debugging Rust HTTP APIs and services, especially when Codex needs black-box integration tests, random-port app startup, real database test…

    1.3k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Art

    hashgraph-online/awesome-codex-plugins

    Make a studio's game look like something at build time — a cover from a real frame of the game (free), painted covers, backdrops, textures and character plates from image models through the…

    1.3k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Calle

    hashgraph-online/awesome-codex-plugins

    Use CALL-E from Codex through the calle CLI. An agent skill from hashgraph-online/awesome-codex-plugins.

    1.3k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Game Balance Economy

    hashgraph-online/awesome-codex-plugins

    Balance game difficulty, resources, rewards, probability, progression, economies, and dominant strategies.

    1.3k GitHub stars~618 tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Better Auth Integration

What does Better Auth Integration do?

Dodo Payments plugin for Better Auth (@dodopayments/better-auth) covering customer sync on signup, authenticated checkout, customer portal, usage ingestion, and verified webhooks. Better Auth Integration is an agent skill from hashgraph-online/awesome-codex-plugins. Dodo Payments plugin for Better Auth (@dodopayments/better-auth) covering customer sync on signup, authenticated checkout, customer portal, usage ingestion, and verified webhooks.

When should I use Better Auth Integration?

Better Auth Integration fits situations like: an app uses Better Auth and needs the dodopayments; dodopaymentsClient; webhooks plugins; for other auth stacks use framework-adapters.

How do I install Better Auth Integration in Claude Code?

Run `npx skills add hashgraph-online/awesome-codex-plugins --skill better-auth-integration -a claude-code`. Or copy the skill folder (plugins/dodopayments/dodo-agent-plugin/skills/better-auth-integration in hashgraph-online/awesome-codex-plugins) into .claude/skills/better-auth-integration in your project. Claude Code loads it when a task matches its description.

How do I install Better Auth Integration in Codex?

Run `npx skills add hashgraph-online/awesome-codex-plugins --skill better-auth-integration -a codex`. Or copy the skill folder (plugins/dodopayments/dodo-agent-plugin/skills/better-auth-integration in hashgraph-online/awesome-codex-plugins) into .agents/skills/better-auth-integration in your project. Codex loads it when a task matches its description.

Can I use Better Auth Integration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hashgraph-online/awesome-codex-plugins --skill better-auth-integration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/better-auth-integration, .gemini/skills/better-auth-integration, .github/skills/better-auth-integration and .opencode/skills/better-auth-integration in your project.

What does Better Auth Integration need to run?

Going by SKILL.md and its folder, Better Auth Integration needs the command-line tools its instructions call (npx and npm) and credentials named DODO_PAYMENTS_API_KEY and DODO_PAYMENTS_WEBHOOK_KEY. Our summary lists: Node.js; A credential in DODO_PAYMENTS_API_KEY; A credential in DODO_PAYMENTS_WEBHOOK_KEY.

Does Better Auth Integration access the network?

SKILL.md names 4 domains. As links in the text: better-auth.com, docs.dodopayments.com, npmjs.com and github.com. This is read from the text; nothing was executed.

Is Better Auth Integration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Better Auth Integration use?

Better Auth Integration is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Better Auth Integration use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Better Auth Integration?

Skills that share tags, products or a category with Better Auth Integration: Workos (usenotra/notra, 256 stars), Better Auth Best Practices (latitude-dev/latitude-llm, 4.7k stars), Novu Design Workflow (novuhq/novu, 40k stars) and Golive (mikehasa/golive-skill, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Better Auth Integration?

hashgraph-online (a GitHub organization) maintains it in hashgraph-online/awesome-codex-plugins, which has 1,255 GitHub stars. The repository holds 714 skills in this directory. The repository was last updated on October 9, 2026.

Source: hashgraph-online/awesome-codex-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.