admin

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package admin wraps the WorkOS management API for internal admin operations. The parent workos package handles OAuth (device flow, token refresh) using a public client ID. This package uses a secret API key for server-side management operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the WorkOS management API, exposing only what we need.

func NewClient

func NewClient(apiKey string) *Client

NewClient creates a new admin client authenticated with a WorkOS API key.

func (*Client) CreateMembership

func (c *Client) CreateMembership(ctx context.Context, userID, orgID string) (Membership, error)

CreateMembership adds a user to an organization.

func (*Client) DeleteMembership

func (c *Client) DeleteMembership(ctx context.Context, membershipID string) error

DeleteMembership removes a user from an organization.

func (*Client) FindMembership

func (c *Client) FindMembership(ctx context.Context, userID, orgID string) (Membership, error)

FindMembership finds a user's membership in an organization. Returns the membership if found, or an error if not found.

type Membership

type Membership struct {
	ID             string
	UserID         string
	OrganizationID string
	Status         string
}

Membership represents a user's membership in an organization.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL