Skip to content

Invalid Adapter config? #28

@curlydoodle

Description

@curlydoodle

Im trying to set this on an existing project where Im using betterauth.

Running into issues.

Is this still valid?

import { betterAuth } from "better-auth"
import { abac, createAbacAdapter } from "better-auth-abac"

// Initialize your database adapter
const abacAdapter = await createAbacAdapter({
    type: "mysql" // mysql | postgres | sqlite
    uri: process.env.DB_URL!
    // filename: "./db" // OPTIONAL FOR SQLITE
})

export const auth = betterAuth({
    // other options here
    plugins: [abac(abacAdapter)]
})

The interface shows this:

interface AbacAdapterConfig {
    db: MysqlConfig | PostgresConfig | SqliteConfig;
}

Also in the plugin array, I think the docs should be updated to show:

abac(abacAdapter, false)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions