Documentation
¶
Overview ¶
Package `widgets` provides a client wrapping the WorkOS Widgets API.
Index ¶
Constants ¶
View Source
const ResponseLimit = 10
ResponseLimit is the default number of records to limit a response to.
Variables ¶
View Source
var (
DefaultClient = &Client{
Endpoint: "https://api.workos.com",
}
)
DefaultClient is the client used by SetAPIKey and Widgets functions.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// The WorkOS API Key. It can be found in https://dashboard.workos.com/api-keys.
APIKey string
// The http.Client that is used to manage Widgets API calls to WorkOS.
// Defaults to http.Client.
HTTPClient *http.Client
// The endpoint to WorkOS API. Defaults to https://api.workos.com.
Endpoint string
// The function used to encode in JSON. Defaults to json.Marshal.
JSONEncode func(v interface{}) ([]byte, error)
// contains filtered or unexported fields
}
Client represents a client that performs Widgets requests to the WorkOS API.
type GetTokenOpts ¶
type GetTokenOpts struct {
// Organization identifier to scope the widget token
OrganizationId string `json:"organization_id"`
// AuthKit user identifier to scope the widget token
UserId string `json:"user_id"`
// WidgetScopes to scope the widget token
Scopes []WidgetScope `json:"scopes"`
}
GetTokenOpts contains the options to get a widget token.
type GetTokenResponse ¶
type GetTokenResponse struct {
// Generated widget token
Token string `json:"token"`
}
GetTokenResponse represents the generated widget token
type WidgetScope ¶
type WidgetScope string
WidgetScope represents a widget token scope.
const (
UsersTableManage WidgetScope = "widgets:users-table:manage"
)
Constants that enumerate the available GenerateLinkIntent types.
Click to show internal directories.
Click to hide internal directories.