npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

better-auth-attio-plugin

v0.3.2

Published

Sync users, workspaces and arbitrary objects between your Better Auth app and Attio

Readme

Attio Better Auth Plugin

A Better Auth plugin for Attio that provides bidirectional sync between your application and Attio, enabling user management, organization sync, and session tracking directly from Attio

  • Sync users, workspaces and arbitrary database objects between your Better Auth app and Attio in both directions
  • Create users, ban/unban them, and send password reset emails directly from Attio
  • View active sessions with device and browser information and revoke them remotely
  • Manage organization members and handle invitations across both systems
  • Impersonate users for support and debugging purposes

Installation

npm install better-auth-attio-plugin
# or
pnpm add better-auth-attio-plugin
# or
bun add better-auth-attio-plugin

Setup

1. Generate Connection Secret

Visit the Attio Connection Generator to create your connection secret:

  1. Enter your application's live URL (e.g., https://your-app.com)
  2. Enter the path to your Better Auth endpoints (default: /api/auth)
  3. Generate the connection secret
  4. Copy the generated base64-encoded connection string

2. Configure the Plugin

Add the Attio plugin to your Better Auth configuration:

import { betterAuth } from "better-auth";
import { attio } from "better-auth-attio-plugin";

export const auth = betterAuth({
  // ... your other config
  plugins: [
    attio({
      secret: process.env.ATTIO_SECRET, // Shared secret for authentication from step 1
      waitUntil: ctx.waitUntil, // Defer sync until after response is sent, for edge environments like Cloudflare Workers
      passwordResetRedirectTo: "/reset-password", // Optional: URL where users reset their password (defaults to "/reset-password")
    }),
    // You'll also want the admin, and organization plugins for full functionality
    admin(),
    organization(),
  ],
});

3. Install the Attio App

In Attio:

  1. Navigate to Settings > Apps
  2. Install the Better Auth integration
  3. Paste the connection string from step 1
  4. The app will automatically set up the required objects and attributes

Configuration

By default, the plugin syncs users and organizations with predefined field mappings. You can customize this behavior with adapters.

Custom Adapters

Adapters control how data is transformed between Better Auth and Attio. Use them to:

  • Add custom fields to the sync
  • Change field mappings
  • Sync custom database models to any Attio object
import { userAdapter } from "better-auth-attio-plugin/adapters";

attio({
  secret: process.env.ATTIO_SECRET,
  adapters: [
    {
      ...userAdapter,
      // Add custom fields to Attio
      attioSchema: {
        ...userAdapter.attioSchema,
        subscription_tier: {
          type: "text",
          title: "Subscription Tier",
        },
      },
      // Map data when syncing to Attio
      toAttio: async (event, values, ctx) => {
        const base = await userAdapter.toAttio(event, values, ctx);
        return {
          ...base,
          subscription_tier: values.metadata?.tier || "free",
        };
      },
    },
  ],
})

[!NOTE] You can create adapters for any Better Auth model to sync with any Attio object, not just users and organizations.

Support

[!NOTE] This app is provided free of charge & published under the permissive MIT License. If you use it for your company, please consider to sponsor me on GitHub to support further development and continued maintenance of the Better Auth Attio App.

License

MIT License Copyright © 2025 Tobias Möritz