Documentation ¶
Index ¶
- Constants
- func RequireSessionV2(client Client, verifyTokenOptions ...VerifyTokenOption) func(handler http.Handler) http.Handler
- func WithSession(client Client) func(handler http.Handler) http.Handler
- func WithSessionV2(client Client, verifyTokenOptions ...VerifyTokenOption) func(handler http.Handler) http.Handler
- type ActorTokenResponse
- type ActorTokenService
- type AllowlistIdentifierResponse
- type AllowlistIdentifiersResponse
- type AllowlistsService
- func (s *AllowlistsService) CreateIdentifier(params CreateAllowlistIdentifierParams) (*AllowlistIdentifierResponse, error)
- func (s *AllowlistsService) DeleteIdentifier(identifierID string) (*DeleteResponse, error)
- func (s *AllowlistsService) ListAllIdentifiers() (*AllowlistIdentifiersResponse, error)
- type BlocklistIdentifierResponse
- type BlocklistIdentifiersResponse
- type BlocklistsService
- func (s *BlocklistsService) CreateIdentifier(params CreateBlocklistIdentifierParams) (*BlocklistIdentifierResponse, error)
- func (s *BlocklistsService) DeleteIdentifier(identifierID string) (*DeleteResponse, error)
- func (s *BlocklistsService) ListAllIdentifiers() (*BlocklistIdentifiersResponse, error)
- type ClerkOption
- type Client
- type ClientResponse
- type ClientsService
- type CreateActorTokenParams
- type CreateAllowlistIdentifierParams
- type CreateBlocklistIdentifierParams
- type CreateEmailAddressParams
- type CreateOrganizationInvitationParams
- type CreateOrganizationMembershipParams
- type CreateOrganizationParams
- type CreatePhoneNumberParams
- type CreateRedirectURLParams
- type CreateSAMLConnectionParams
- type CreateUpdateJWTTemplate
- type CreateUserParams
- type DeleteResponse
- type Email
- type EmailAddress
- type EmailAddressesService
- func (s *EmailAddressesService) Create(params CreateEmailAddressParams) (*EmailAddress, error)
- func (s *EmailAddressesService) Delete(emailAddressID string) (*DeleteResponse, error)
- func (s *EmailAddressesService) Read(emailAddressID string) (*EmailAddress, error)
- func (s *EmailAddressesService) Update(emailAddressID string, params UpdateEmailAddressParams) (*EmailAddress, error)
- type EmailResponse
- type EmailService
- type Error
- type ErrorResponse
- type IdentificationLink
- type InstanceRestrictionsResponse
- type InstanceService
- func (s *InstanceService) Update(params UpdateInstanceParams) error
- func (s *InstanceService) UpdateHomeURL(params UpdateHomeURLParams) error
- func (s *InstanceService) UpdateOrganizationSettings(params UpdateOrganizationSettingsParams) (*OrganizationSettingsResponse, error)
- func (s *InstanceService) UpdateRestrictions(params UpdateRestrictionsParams) (*InstanceRestrictionsResponse, error)
- type JWKS
- type JWKSService
- type JWTTemplate
- type JWTTemplatesService
- func (s JWTTemplatesService) Create(params *CreateUpdateJWTTemplate) (*JWTTemplate, error)
- func (s JWTTemplatesService) Delete(id string) (*DeleteResponse, error)
- func (s JWTTemplatesService) ListAll() ([]JWTTemplate, error)
- func (s JWTTemplatesService) Read(id string) (*JWTTemplate, error)
- func (s JWTTemplatesService) Update(id string, params *CreateUpdateJWTTemplate) (*JWTTemplate, error)
- type ListAllOrganizationsParams
- type ListAllUsersParams
- type ListMembershipsParams
- type ListOrganizationMembershipsParams
- type ListOrganizationMembershipsResponse
- type Organization
- type OrganizationInvitation
- type OrganizationMembership
- type OrganizationSettingsResponse
- type OrganizationsResponse
- type OrganizationsService
- func (s *OrganizationsService) Create(params CreateOrganizationParams) (*Organization, error)
- func (s *OrganizationsService) CreateInvitation(params CreateOrganizationInvitationParams) (*OrganizationInvitation, error)
- func (s *OrganizationsService) CreateMembership(organizationID string, params CreateOrganizationMembershipParams) (*OrganizationMembership, error)
- func (s *OrganizationsService) Delete(organizationID string) (*DeleteResponse, error)
- func (s *OrganizationsService) DeleteMembership(organizationID, userID string) (*OrganizationMembership, error)
- func (s *OrganizationsService) ListAll(params ListAllOrganizationsParams) (*OrganizationsResponse, error)
- func (s *OrganizationsService) ListMemberships(params ListOrganizationMembershipsParams) (*ListOrganizationMembershipsResponse, error)
- func (s *OrganizationsService) Read(organizationIDOrSlug string) (*Organization, error)
- func (s *OrganizationsService) Update(organizationID string, params UpdateOrganizationParams) (*Organization, error)
- func (s *OrganizationsService) UpdateMembership(organizationID string, params UpdateOrganizationMembershipParams) (*OrganizationMembership, error)
- func (s *OrganizationsService) UpdateMetadata(organizationID string, params UpdateOrganizationMetadataParams) (*Organization, error)
- type PaginationParams
- type PhoneNumber
- type PhoneNumbersService
- func (s *PhoneNumbersService) Create(params CreatePhoneNumberParams) (*PhoneNumber, error)
- func (s *PhoneNumbersService) Delete(phoneNumberID string) (*DeleteResponse, error)
- func (s *PhoneNumbersService) Read(phoneNumberID string) (*PhoneNumber, error)
- func (s *PhoneNumbersService) Update(phoneNumberID string, params UpdatePhoneNumberParams) (*PhoneNumber, error)
- type PreviewTemplateRequest
- type RedirectURLResponse
- type RedirectURLsService
- type SAMLConnection
- type SAMLConnectionsService
- func (s SAMLConnectionsService) Create(params *CreateSAMLConnectionParams) (*SAMLConnection, error)
- func (s SAMLConnectionsService) Delete(id string) (*DeleteResponse, error)
- func (s SAMLConnectionsService) ListAll() ([]SAMLConnection, error)
- func (s SAMLConnectionsService) Read(id string) (*SAMLConnection, error)
- func (s SAMLConnectionsService) Update(id string, params *UpdateSAMLConnectionParams) (*SAMLConnection, error)
- type SMSMessage
- type SMSMessageResponse
- type SMSService
- type Session
- type SessionClaims
- type SessionsService
- type SvixResponse
- type Template
- type TemplateExtended
- type TemplatePreview
- type TemplatesService
- func (s *TemplatesService) Delete(templateType, slug string) (*DeleteResponse, error)
- func (s *TemplatesService) ListAll(templateType string) ([]Template, error)
- func (s *TemplatesService) Preview(templateType, slug string, previewTemplateRequest *PreviewTemplateRequest) (*TemplatePreview, error)
- func (s *TemplatesService) Read(templateType, slug string) (*TemplateExtended, error)
- func (s *TemplatesService) Revert(templateType, slug string) (*TemplateExtended, error)
- func (s *TemplatesService) Upsert(templateType, slug string, upsertTemplateRequest *UpsertTemplateRequest) (*TemplateExtended, error)
- type TokenClaims
- type UpdateEmailAddressParams
- type UpdateHomeURLParams
- type UpdateInstanceParams
- type UpdateOrganizationMembershipParams
- type UpdateOrganizationMetadataParams
- type UpdateOrganizationParams
- type UpdateOrganizationSettingsParams
- type UpdatePhoneNumberParams
- type UpdateRestrictionsParams
- type UpdateSAMLConnectionParams
- type UpdateUser
- type UpdateUserMetadata
- type UpsertTemplateRequest
- type User
- type UserCount
- type UserDisableMFAResponse
- type UserOAuthAccessToken
- type UsersService
- func (s *UsersService) Ban(userID string) (*User, error)
- func (s *UsersService) Count(params ListAllUsersParams) (*UserCount, error)
- func (s *UsersService) Create(params CreateUserParams) (*User, error)
- func (s *UsersService) Delete(userId string) (*DeleteResponse, error)
- func (s *UsersService) DisableMFA(userID string) (*UserDisableMFAResponse, error)
- func (s *UsersService) ListAll(params ListAllUsersParams) ([]User, error)
- func (s *UsersService) ListMemberships(params ListMembershipsParams) (*ListOrganizationMembershipsResponse, error)
- func (s *UsersService) ListOAuthAccessTokens(userID, provider string) ([]*UserOAuthAccessToken, error)
- func (s *UsersService) Read(userId string) (*User, error)
- func (s *UsersService) Unban(userID string) (*User, error)
- func (s *UsersService) Update(userId string, updateRequest *UpdateUser) (*User, error)
- func (s *UsersService) UpdateMetadata(userId string, updateMetadataRequest *UpdateUserMetadata) (*User, error)
- type Verification
- type VerificationService
- type VerifyTokenOption
- type Web3Wallet
- type WebhooksService
- type ΟrganizationMembershipPublicUserData
Constants ¶
const ( ProdUrl = "https://api.clerk.dev/v1/" ActorTokensUrl = "actor_tokens" AllowlistsUrl = "allowlist_identifiers" BlocklistsUrl = "blocklist_identifiers" ClientsUrl = "clients" ClientsVerifyUrl = ClientsUrl + "/verify" EmailAddressesURL = "email_addresses" EmailsUrl = "emails" InvitationsURL = "invitations" OrganizationsUrl = "organizations" PhoneNumbersURL = "phone_numbers" RedirectURLsUrl = "redirect_urls" SAMLConnectionsUrl = "saml_connections" SessionsUrl = "sessions" SMSUrl = "sms_messages" TemplatesUrl = "templates" UsersUrl = "users" UsersCountUrl = UsersUrl + "/count" WebhooksUrl = "webhooks" JWTTemplatesUrl = "jwt_templates" )
const ( ActiveSession = iota ActiveSessionClaims )
const ( CookieSession = "__session" QueryParamSessionId = "_clerk_session_id" )
Variables ¶
This section is empty.
Functions ¶
func RequireSessionV2 ¶ added in v1.1.0
func RequireSessionV2(client Client, verifyTokenOptions ...VerifyTokenOption) func(handler http.Handler) http.Handler
RequireSessionV2 will hijack the request and return an HTTP status 403 if the session is not authenticated.
func WithSession ¶ added in v1.0.3
func WithSessionV2 ¶ added in v1.1.0
func WithSessionV2(client Client, verifyTokenOptions ...VerifyTokenOption) func(handler http.Handler) http.Handler
WithSessionV2 is the new middleware that supports Auth v2. If the session is authenticated, it adds the corresponding session claims found in the JWT to request's context.
Types ¶
type ActorTokenResponse ¶ added in v1.22.0
type ActorTokenService ¶ added in v1.22.0
type ActorTokenService service
func (*ActorTokenService) Create ¶ added in v1.22.0
func (s *ActorTokenService) Create(params CreateActorTokenParams) (*ActorTokenResponse, error)
func (*ActorTokenService) Revoke ¶ added in v1.22.0
func (s *ActorTokenService) Revoke(actorTokenID string) (*ActorTokenResponse, error)
type AllowlistIdentifierResponse ¶ added in v1.16.0
type AllowlistIdentifierResponse struct { Object string `json:"object"` ID string `json:"id"` InvitationID string `json:"invitation_id,omitempty"` Identifier string `json:"identifier"` IdentifierType string `json:"identifier_type"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
type AllowlistIdentifiersResponse ¶ added in v1.16.0
type AllowlistIdentifiersResponse struct { Data []*AllowlistIdentifierResponse `json:"data"` TotalCount int64 `json:"total_count"` }
type AllowlistsService ¶ added in v1.16.0
type AllowlistsService service
func (*AllowlistsService) CreateIdentifier ¶ added in v1.16.0
func (s *AllowlistsService) CreateIdentifier(params CreateAllowlistIdentifierParams) (*AllowlistIdentifierResponse, error)
func (*AllowlistsService) DeleteIdentifier ¶ added in v1.16.0
func (s *AllowlistsService) DeleteIdentifier(identifierID string) (*DeleteResponse, error)
func (*AllowlistsService) ListAllIdentifiers ¶ added in v1.16.0
func (s *AllowlistsService) ListAllIdentifiers() (*AllowlistIdentifiersResponse, error)
type BlocklistIdentifierResponse ¶ added in v1.15.0
type BlocklistIdentifiersResponse ¶ added in v1.15.0
type BlocklistIdentifiersResponse struct { Data []*BlocklistIdentifierResponse `json:"data"` TotalCount int64 `json:"total_count"` }
type BlocklistsService ¶ added in v1.15.0
type BlocklistsService service
func (*BlocklistsService) CreateIdentifier ¶ added in v1.15.0
func (s *BlocklistsService) CreateIdentifier(params CreateBlocklistIdentifierParams) (*BlocklistIdentifierResponse, error)
func (*BlocklistsService) DeleteIdentifier ¶ added in v1.15.0
func (s *BlocklistsService) DeleteIdentifier(identifierID string) (*DeleteResponse, error)
func (*BlocklistsService) ListAllIdentifiers ¶ added in v1.15.0
func (s *BlocklistsService) ListAllIdentifiers() (*BlocklistIdentifiersResponse, error)
type ClerkOption ¶ added in v1.2.0
type ClerkOption func(*client) error
ClerkOption describes a functional parameter for the clerk client constructor
func WithBaseURL ¶ added in v1.2.0
func WithBaseURL(rawURL string) ClerkOption
WithBaseURL allows the overriding of the base URL
func WithHTTPClient ¶ added in v1.2.0
func WithHTTPClient(httpClient *http.Client) ClerkOption
WithHTTPClient allows the overriding of the http client
type Client ¶
type Client interface { NewRequest(method, url string, body ...interface{}) (*http.Request, error) Do(req *http.Request, v interface{}) (*http.Response, error) DecodeToken(token string) (*TokenClaims, error) VerifyToken(token string, opts ...VerifyTokenOption) (*SessionClaims, error) Allowlists() *AllowlistsService Blocklists() *BlocklistsService Clients() *ClientsService EmailAddresses() *EmailAddressesService Emails() *EmailService ActorTokens() *ActorTokenService Instances() *InstanceService JWKS() *JWKSService JWTTemplates() *JWTTemplatesService Organizations() *OrganizationsService PhoneNumbers() *PhoneNumbersService RedirectURLs() *RedirectURLsService SAMLConnections() *SAMLConnectionsService Sessions() *SessionsService SMS() *SMSService Templates() *TemplatesService Users() *UsersService Webhooks() *WebhooksService Verification() *VerificationService Interstitial() ([]byte, error) APIKey() string }
func NewClient ¶
func NewClient(token string, options ...ClerkOption) (Client, error)
NewClient creates a new Clerk client. Because the token supplied will be used for all authenticated requests, the created client should not be used across different users
func NewClientWithBaseUrl
deprecated
type ClientResponse ¶ added in v1.0.3
type ClientsService ¶ added in v1.0.3
type ClientsService service
func (*ClientsService) ListAll ¶ added in v1.0.3
func (s *ClientsService) ListAll() ([]ClientResponse, error)
func (*ClientsService) Read ¶ added in v1.0.3
func (s *ClientsService) Read(clientId string) (*ClientResponse, error)
func (*ClientsService) Verify ¶ added in v1.0.3
func (s *ClientsService) Verify(token string) (*ClientResponse, error)
type CreateActorTokenParams ¶ added in v1.22.0
type CreateActorTokenParams struct { UserID string `json:"user_id"` Actor json.RawMessage `json:"actor"` ExpiresInSeconds *int `json:"expires_in_seconds"` SessionMaxDurationInSeconds *int `json:"session_max_duration_in_seconds"` }
type CreateAllowlistIdentifierParams ¶ added in v1.16.0
type CreateBlocklistIdentifierParams ¶ added in v1.15.0
type CreateBlocklistIdentifierParams struct {
Identifier string `json:"identifier"`
}
type CreateEmailAddressParams ¶ added in v1.28.0
type CreateOrganizationInvitationParams ¶ added in v1.28.0
type CreateOrganizationInvitationParams struct { EmailAddress string `json:"email_address"` InviterUserID string `json:"inviter_user_id"` OrganizationID string `json:"organization_id"` PublicMetadata json.RawMessage `json:"public_metadata,omitempty"` RedirectURL string `json:"redirect_url,omitempty"` Role string `json:"role"` }
type CreateOrganizationMembershipParams ¶ added in v1.32.0
type CreateOrganizationParams ¶ added in v1.25.0
type CreateOrganizationParams struct { Name string `json:"name"` Slug *string `json:"slug,omitempty"` CreatedBy string `json:"created_by"` MaxAllowedMemberships *int `json:"max_allowed_memberships,omitempty"` PublicMetadata json.RawMessage `json:"public_metadata,omitempty"` PrivateMetadata json.RawMessage `json:"private_metadata,omitempty"` }
type CreatePhoneNumberParams ¶ added in v1.28.0
type CreateRedirectURLParams ¶ added in v1.13.0
type CreateRedirectURLParams struct {
URL string `json:"url"`
}
type CreateSAMLConnectionParams ¶ added in v1.38.3
type CreateUpdateJWTTemplate ¶ added in v1.2.0
type CreateUpdateJWTTemplate struct { Name string `json:"name"` Claims map[string]interface{} `json:"claims"` Lifetime *int `json:"lifetime"` AllowedClockSkew *int `json:"allowed_clock_skew"` CustomSigningKey bool `json:"custom_signing_key"` SigningAlgorithm *string `json:"signing_algorithm"` SigningKey *string `json:"signing_key"` }
type CreateUserParams ¶ added in v1.18.0
type CreateUserParams struct { EmailAddresses []string `json:"email_address,omitempty"` PhoneNumbers []string `json:"phone_number,omitempty"` Web3Wallets []string `json:"web3_wallet,omitempty"` Username *string `json:"username,omitempty"` Password *string `json:"password,omitempty"` FirstName *string `json:"first_name,omitempty"` LastName *string `json:"last_name,omitempty"` ExternalID *string `json:"external_id,omitempty"` UnsafeMetadata *json.RawMessage `json:"unsafe_metadata,omitempty"` PublicMetadata *json.RawMessage `json:"public_metadata,omitempty"` PrivateMetadata *json.RawMessage `json:"private_metadata,omitempty"` PasswordDigest *string `json:"password_digest,omitempty"` PasswordHasher *string `json:"password_hasher,omitempty"` SkipPasswordRequirement *bool `json:"skip_password_requirement,omitempty"` SkipPasswordChecks *bool `json:"skip_password_checks,omitempty"` TOTPSecret *string `json:"totp_secret,omitempty"` BackupCodes []string `json:"backup_codes,omitempty"` // Specified in RFC3339 format CreatedAt *string `json:"created_at,omitempty"` }
type DeleteResponse ¶
type EmailAddress ¶
type EmailAddress struct { ID string `json:"id"` Object string `json:"object"` EmailAddress string `json:"email_address"` Reserved bool `json:"reserved"` Verification *Verification `json:"verification"` LinkedTo []IdentificationLink `json:"linked_to"` }
type EmailAddressesService ¶ added in v1.28.0
type EmailAddressesService service
func (*EmailAddressesService) Create ¶ added in v1.28.0
func (s *EmailAddressesService) Create(params CreateEmailAddressParams) (*EmailAddress, error)
func (*EmailAddressesService) Delete ¶ added in v1.28.0
func (s *EmailAddressesService) Delete(emailAddressID string) (*DeleteResponse, error)
func (*EmailAddressesService) Read ¶ added in v1.28.0
func (s *EmailAddressesService) Read(emailAddressID string) (*EmailAddress, error)
func (*EmailAddressesService) Update ¶ added in v1.28.0
func (s *EmailAddressesService) Update(emailAddressID string, params UpdateEmailAddressParams) (*EmailAddress, error)
type EmailResponse ¶
type EmailService ¶
type EmailService service
func (*EmailService) Create ¶
func (s *EmailService) Create(email Email) (*EmailResponse, error)
type ErrorResponse ¶ added in v1.0.5
func (*ErrorResponse) Error ¶ added in v1.0.5
func (e *ErrorResponse) Error() string
type IdentificationLink ¶
type InstanceRestrictionsResponse ¶ added in v1.16.0
type InstanceService ¶ added in v1.10.0
type InstanceService service
func (*InstanceService) Update ¶ added in v1.10.0
func (s *InstanceService) Update(params UpdateInstanceParams) error
func (*InstanceService) UpdateHomeURL ¶ added in v1.38.1
func (s *InstanceService) UpdateHomeURL(params UpdateHomeURLParams) error
func (*InstanceService) UpdateOrganizationSettings ¶ added in v1.23.0
func (s *InstanceService) UpdateOrganizationSettings(params UpdateOrganizationSettingsParams) (*OrganizationSettingsResponse, error)
func (*InstanceService) UpdateRestrictions ¶ added in v1.16.0
func (s *InstanceService) UpdateRestrictions(params UpdateRestrictionsParams) (*InstanceRestrictionsResponse, error)
type JWKSService ¶ added in v1.1.0
type JWKSService service
func (*JWKSService) ListAll ¶ added in v1.1.0
func (s *JWKSService) ListAll() (*JWKS, error)
type JWTTemplate ¶ added in v1.2.0
type JWTTemplate struct { ID string `json:"id"` Object string `json:"object"` Name string `json:"name"` Claims json.RawMessage `json:"claims"` Lifetime int `json:"lifetime"` AllowedClockSkew int `json:"allowed_clock_skew"` CustomSigningKey bool `json:"custom_signing_key"` SigningAlgorithm string `json:"signing_algorithm"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
type JWTTemplatesService ¶ added in v1.2.0
type JWTTemplatesService service
func (JWTTemplatesService) Create ¶ added in v1.2.0
func (s JWTTemplatesService) Create(params *CreateUpdateJWTTemplate) (*JWTTemplate, error)
func (JWTTemplatesService) Delete ¶ added in v1.2.0
func (s JWTTemplatesService) Delete(id string) (*DeleteResponse, error)
func (JWTTemplatesService) ListAll ¶ added in v1.2.0
func (s JWTTemplatesService) ListAll() ([]JWTTemplate, error)
func (JWTTemplatesService) Read ¶ added in v1.2.0
func (s JWTTemplatesService) Read(id string) (*JWTTemplate, error)
func (JWTTemplatesService) Update ¶ added in v1.2.0
func (s JWTTemplatesService) Update(id string, params *CreateUpdateJWTTemplate) (*JWTTemplate, error)
type ListAllOrganizationsParams ¶ added in v1.6.0
type ListAllUsersParams ¶ added in v1.0.9
type ListMembershipsParams ¶ added in v1.35.1
type ListOrganizationMembershipsParams ¶ added in v1.32.0
type ListOrganizationMembershipsParams struct { OrganizationID string Limit *int Offset *int Roles []string `json:"role"` UserIDs []string `json:"user_id"` EmailAddresses []string `json:"email_address"` PhoneNumbers []string `json:"phone_number"` Usernames []string `json:"username"` Web3Wallets []string `json:"web3_wallet"` OrderBy *string `json:"order_by"` Query *string `json:"query"` }
type ListOrganizationMembershipsResponse ¶ added in v1.32.0
type ListOrganizationMembershipsResponse struct { Data []OrganizationMembership `json:"data"` TotalCount int64 `json:"total_count"` }
type Organization ¶ added in v1.6.0
type Organization struct { Object string `json:"object"` ID string `json:"id"` Name string `json:"name"` Slug *string `json:"slug"` LogoURL *string `json:"logo_url"` ImageURL *string `json:"image_url,omitempty"` MembersCount *int `json:"members_count,omitempty"` MaxAllowedMemberships int `json:"max_allowed_memberships"` PublicMetadata json.RawMessage `json:"public_metadata"` PrivateMetadata json.RawMessage `json:"private_metadata,omitempty"` CreatedBy string `json:"created_by"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
type OrganizationInvitation ¶ added in v1.28.0
type OrganizationInvitation struct { Object string `json:"object"` ID string `json:"id"` EmailAddress string `json:"email_address"` OrganizationID string `json:"organization_id"` PublicMetadata json.RawMessage `json:"public_metadata"` Role string `json:"role"` Status string `json:"status"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
type OrganizationMembership ¶ added in v1.32.0
type OrganizationMembership struct { Object string `json:"object"` ID string `json:"id"` PublicMetadata json.RawMessage `json:"public_metadata"` PrivateMetadata json.RawMessage `json:"private_metadata"` Role string `json:"role"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` Organization *Organization `json:"organization"` PublicUserData *ΟrganizationMembershipPublicUserData `json:"public_user_data"` }
type OrganizationSettingsResponse ¶ added in v1.23.0
type OrganizationsResponse ¶ added in v1.6.0
type OrganizationsResponse struct { Data []Organization `json:"data"` TotalCount int64 `json:"total_count"` }
type OrganizationsService ¶ added in v1.6.0
type OrganizationsService service
func (*OrganizationsService) Create ¶ added in v1.25.0
func (s *OrganizationsService) Create(params CreateOrganizationParams) (*Organization, error)
func (*OrganizationsService) CreateInvitation ¶ added in v1.28.0
func (s *OrganizationsService) CreateInvitation(params CreateOrganizationInvitationParams) (*OrganizationInvitation, error)
func (*OrganizationsService) CreateMembership ¶ added in v1.32.0
func (s *OrganizationsService) CreateMembership(organizationID string, params CreateOrganizationMembershipParams) (*OrganizationMembership, error)
func (*OrganizationsService) Delete ¶ added in v1.25.0
func (s *OrganizationsService) Delete(organizationID string) (*DeleteResponse, error)
func (*OrganizationsService) DeleteMembership ¶ added in v1.33.0
func (s *OrganizationsService) DeleteMembership(organizationID, userID string) (*OrganizationMembership, error)
func (*OrganizationsService) ListAll ¶ added in v1.6.0
func (s *OrganizationsService) ListAll(params ListAllOrganizationsParams) (*OrganizationsResponse, error)
func (*OrganizationsService) ListMemberships ¶ added in v1.32.0
func (s *OrganizationsService) ListMemberships(params ListOrganizationMembershipsParams) (*ListOrganizationMembershipsResponse, error)
func (*OrganizationsService) Read ¶ added in v1.29.0
func (s *OrganizationsService) Read(organizationIDOrSlug string) (*Organization, error)
func (*OrganizationsService) Update ¶ added in v1.25.0
func (s *OrganizationsService) Update(organizationID string, params UpdateOrganizationParams) (*Organization, error)
func (*OrganizationsService) UpdateMembership ¶ added in v1.32.0
func (s *OrganizationsService) UpdateMembership(organizationID string, params UpdateOrganizationMembershipParams) (*OrganizationMembership, error)
func (*OrganizationsService) UpdateMetadata ¶ added in v1.29.1
func (s *OrganizationsService) UpdateMetadata(organizationID string, params UpdateOrganizationMetadataParams) (*Organization, error)
type PaginationParams ¶ added in v1.35.1
type PhoneNumber ¶
type PhoneNumber struct { ID string `json:"id"` Object string `json:"object"` PhoneNumber string `json:"phone_number"` ReservedForSecondFactor bool `json:"reserved_for_second_factor"` DefaultSecondFactor bool `json:"default_second_factor"` Reserved bool `json:"reserved"` Verification *Verification `json:"verification"` LinkedTo []IdentificationLink `json:"linked_to"` BackupCodes []string `json:"backup_codes"` }
type PhoneNumbersService ¶ added in v1.28.0
type PhoneNumbersService service
func (*PhoneNumbersService) Create ¶ added in v1.28.0
func (s *PhoneNumbersService) Create(params CreatePhoneNumberParams) (*PhoneNumber, error)
func (*PhoneNumbersService) Delete ¶ added in v1.28.0
func (s *PhoneNumbersService) Delete(phoneNumberID string) (*DeleteResponse, error)
func (*PhoneNumbersService) Read ¶ added in v1.28.0
func (s *PhoneNumbersService) Read(phoneNumberID string) (*PhoneNumber, error)
func (*PhoneNumbersService) Update ¶ added in v1.28.0
func (s *PhoneNumbersService) Update(phoneNumberID string, params UpdatePhoneNumberParams) (*PhoneNumber, error)
type PreviewTemplateRequest ¶ added in v1.2.0
type RedirectURLResponse ¶ added in v1.13.0
type RedirectURLsService ¶ added in v1.13.0
type RedirectURLsService service
func (*RedirectURLsService) Create ¶ added in v1.13.0
func (s *RedirectURLsService) Create(params CreateRedirectURLParams) (*RedirectURLResponse, error)
func (*RedirectURLsService) Delete ¶ added in v1.13.0
func (s *RedirectURLsService) Delete(redirectURLID string) (*DeleteResponse, error)
func (*RedirectURLsService) ListAll ¶ added in v1.13.0
func (s *RedirectURLsService) ListAll() ([]*RedirectURLResponse, error)
type SAMLConnection ¶ added in v1.38.3
type SAMLConnection struct { ID string `json:"id"` Object string `json:"object"` Name string `json:"name"` Domain string `json:"domain"` IdpEntityID string `json:"idp_entity_id"` IdpSsoURL string `json:"idp_sso_url"` IdpCertificate string `json:"idp_certificate"` AcsURL string `json:"acs_url"` SPEntityID string `json:"sp_entity_id"` Active bool `json:"active"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
type SAMLConnectionsService ¶ added in v1.38.3
type SAMLConnectionsService service
func (SAMLConnectionsService) Create ¶ added in v1.38.3
func (s SAMLConnectionsService) Create(params *CreateSAMLConnectionParams) (*SAMLConnection, error)
func (SAMLConnectionsService) Delete ¶ added in v1.38.3
func (s SAMLConnectionsService) Delete(id string) (*DeleteResponse, error)
func (SAMLConnectionsService) ListAll ¶ added in v1.38.3
func (s SAMLConnectionsService) ListAll() ([]SAMLConnection, error)
func (SAMLConnectionsService) Read ¶ added in v1.38.3
func (s SAMLConnectionsService) Read(id string) (*SAMLConnection, error)
func (SAMLConnectionsService) Update ¶ added in v1.38.3
func (s SAMLConnectionsService) Update(id string, params *UpdateSAMLConnectionParams) (*SAMLConnection, error)
type SMSMessage ¶
type SMSMessageResponse ¶
type SMSMessageResponse struct { Object string `json:"object"` ID string `json:"id"` FromPhoneNumber string `json:"from_phone_number"` ToPhoneNumber *string `json:"to_phone_number,omitempty"` Status string `json:"status"` DeliveredByClerk bool `json:"delivered_by_clerk"` Data json.RawMessage `json:"data"` SMSMessage }
type SMSService ¶
type SMSService service
func (*SMSService) Create ¶
func (s *SMSService) Create(message SMSMessage) (*SMSMessageResponse, error)
type SessionClaims ¶ added in v1.1.0
type SessionClaims struct { jwt.Claims SessionID string `json:"sid"` AuthorizedParty string `json:"azp"` ActiveOrganizationID string `json:"org_id"` ActiveOrganizationSlug string `json:"org_slug"` ActiveOrganizationRole string `json:"org_role"` }
func SessionFromContext ¶ added in v1.1.0
func SessionFromContext(ctx context.Context) (*SessionClaims, bool)
SessionFromContext returns the session's (if any) claims, as parsed from the token.
type SessionsService ¶
type SessionsService service
func (*SessionsService) ListAll ¶
func (s *SessionsService) ListAll() ([]Session, error)
type SvixResponse ¶ added in v1.1.0
type SvixResponse struct {
SvixURL string `json:"svix_url"`
}
type Template ¶ added in v1.2.0
type Template struct { Object string `json:"object"` Slug string `json:"slug"` ResourceType string `json:"resource_type"` TemplateType string `json:"template_type"` Name string `json:"name"` Position int `json:"position"` CanRevert bool `json:"can_revert"` CanDelete bool `json:"can_delete"` FromEmailName *string `json:"from_email_name"` DeliveredByClerk bool `json:"delivered_by_clerk"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
type TemplateExtended ¶ added in v1.2.0
type TemplatePreview ¶ added in v1.2.0
type TemplatesService ¶ added in v1.2.0
type TemplatesService service
func (*TemplatesService) Delete ¶ added in v1.2.0
func (s *TemplatesService) Delete(templateType, slug string) (*DeleteResponse, error)
Delete deletes a custom user template
func (*TemplatesService) ListAll ¶ added in v1.2.0
func (s *TemplatesService) ListAll(templateType string) ([]Template, error)
func (*TemplatesService) Preview ¶ added in v1.2.0
func (s *TemplatesService) Preview(templateType, slug string, previewTemplateRequest *PreviewTemplateRequest) (*TemplatePreview, error)
Preview returns a rendering of a template with sample data for preview purposes
func (*TemplatesService) Read ¶ added in v1.2.0
func (s *TemplatesService) Read(templateType, slug string) (*TemplateExtended, error)
func (*TemplatesService) Revert ¶ added in v1.2.0
func (s *TemplatesService) Revert(templateType, slug string) (*TemplateExtended, error)
Revert reverts a user template to the corresponding system template
func (*TemplatesService) Upsert ¶ added in v1.2.0
func (s *TemplatesService) Upsert(templateType, slug string, upsertTemplateRequest *UpsertTemplateRequest) (*TemplateExtended, error)
type TokenClaims ¶ added in v1.1.0
type UpdateEmailAddressParams ¶ added in v1.28.0
type UpdateHomeURLParams ¶ added in v1.38.1
type UpdateHomeURLParams struct {
HomeURL string `json:"home_url"`
}
type UpdateInstanceParams ¶ added in v1.10.0
type UpdateInstanceParams struct { // TestMode can be used to toggle test mode for this instance. // Defaults to true for development instances. TestMode *bool `json:"test_mode,omitempty"` // HIBP is used to configure whether Clerk should use the // "Have I Been Pawned" service to check passwords against // known security breaches. // By default, this is enabled in all instances. HIBP *bool `json:"hibp,omitempty"` // EnhancedEmailDeliverability controls how Clerk delivers emails. // Specifically, when set to true, if the instance is a production // instance, OTP verification emails are sent by the Clerk's shared // domain via Postmark. EnhancedEmailDeliverability *bool `json:"enhanced_email_deliverability,omitempty"` // SupportEmail is the contact email address that will be displayed // on the frontend, in case your instance users need support. // If the empty string is provided, the support email that is currently // configured in the instance will be removed. SupportEmail *string `json:"support_email,omitempty"` // ClerkJSVersion allows you to request a specific Clerk JS version on the Clerk Hosted Account pages. // If an empty string is provided, the stored version will be removed. // If an explicit version is not set, the Clerk JS version will be automatically be resolved. ClerkJSVersion *string `json:"clerk_js_version,omitempty"` // CookielessDev can be used to enable the new mode in which no third-party // cookies are used in development instances. Make sure to also enable the // setting in Clerk.js // // Deprecated: Use URLBasedSessionSyncing instead CookielessDev *bool `json:"cookieless_dev,omitempty"` // URLBasedSessionSyncing can be used to enable the new mode in which no third-party // cookies are used in development instances. Make sure to also enable the // setting in Clerk.js URLBasedSessionSyncing *bool `json:"url_based_session_syncing,omitempty"` // URL that is going to be used in development instances in order to create custom redirects // and fix the third-party cookies issues. DevelopmentOrigin *string `json:"development_origin,omitempty"` // DisableSignUps can be used to allow or disable sign ups on the current instance. // If they are disabled, users can no longer sign up on their own, but they need // to be manually added by an administrator. DisableSignUps *bool `json:"disable_sign_ups,omitempty"` }
type UpdateOrganizationMembershipParams ¶ added in v1.32.0
type UpdateOrganizationMetadataParams ¶ added in v1.29.1
type UpdateOrganizationMetadataParams struct { PublicMetadata json.RawMessage `json:"public_metadata,omitempty"` PrivateMetadata json.RawMessage `json:"private_metadata,omitempty"` }
type UpdateOrganizationParams ¶ added in v1.25.0
type UpdateOrganizationParams struct { Name *string `json:"name,omitempty"` MaxAllowedMemberships *int `json:"max_allowed_memberships,omitempty"` PublicMetadata json.RawMessage `json:"public_metadata,omitempty"` PrivateMetadata json.RawMessage `json:"private_metadata,omitempty"` }
type UpdateOrganizationSettingsParams ¶ added in v1.23.0
type UpdatePhoneNumberParams ¶ added in v1.28.0
type UpdateRestrictionsParams ¶ added in v1.16.0
type UpdateSAMLConnectionParams ¶ added in v1.38.3
type UpdateSAMLConnectionParams struct { Name *string `json:"name,omitempty"` Domain *string `json:"domain,omitempty"` IdpEntityID *string `json:"idp_entity_id,omitempty"` IdpSsoURL *string `json:"idp_sso_url,omitempty"` IdpCertificate *string `json:"idp_certificate,omitempty"` Active *bool `json:"active,omitempty"` }
type UpdateUser ¶
type UpdateUser struct { FirstName *string `json:"first_name,omitempty"` LastName *string `json:"last_name,omitempty"` PrimaryEmailAddressID *string `json:"primary_email_address_id,omitempty"` PrimaryPhoneNumberID *string `json:"primary_phone_number_id,omitempty"` PrimaryWeb3WalletID *string `json:"primary_web3_wallet_id,omitempty"` Username *string `json:"username,omitempty"` ProfileImageID *string `json:"profile_image_id,omitempty"` ProfileImage *string `json:"profile_image,omitempty"` Password *string `json:"password,omitempty"` SkipPasswordChecks *bool `json:"skip_password_checks,omitempty"` SignOutOfOtherSessions *bool `json:"sign_out_of_other_sessions,omitempty"` ExternalID *string `json:"external_id,omitempty"` PublicMetadata interface{} `json:"public_metadata,omitempty"` PrivateMetadata interface{} `json:"private_metadata,omitempty"` UnsafeMetadata interface{} `json:"unsafe_metadata,omitempty"` TOTPSecret *string `json:"totp_secret,omitempty"` BackupCodes []string `json:"backup_codes,omitempty"` // Specified in RFC3339 format CreatedAt *string `json:"created_at,omitempty"` }
type UpdateUserMetadata ¶ added in v1.9.0
type UpdateUserMetadata struct { PublicMetadata json.RawMessage `json:"public_metadata"` PrivateMetadata json.RawMessage `json:"private_metadata"` UnsafeMetadata json.RawMessage `json:"unsafe_metadata"` }
type UpsertTemplateRequest ¶ added in v1.2.0
type User ¶
type User struct { ID string `json:"id"` Object string `json:"object"` Username *string `json:"username"` FirstName *string `json:"first_name"` LastName *string `json:"last_name"` Gender *string `json:"gender"` Birthday *string `json:"birthday"` ProfileImageURL string `json:"profile_image_url"` PrimaryEmailAddressID *string `json:"primary_email_address_id"` PrimaryPhoneNumberID *string `json:"primary_phone_number_id"` PrimaryWeb3WalletID *string `json:"primary_web3_wallet_id"` PasswordEnabled bool `json:"password_enabled"` TwoFactorEnabled bool `json:"two_factor_enabled"` TOTPEnabled bool `json:"totp_enabled"` BackupCodeEnabled bool `json:"backup_code_enabled"` EmailAddresses []EmailAddress `json:"email_addresses"` PhoneNumbers []PhoneNumber `json:"phone_numbers"` Web3Wallets []Web3Wallet `json:"web3_wallets"` ExternalAccounts []interface{} `json:"external_accounts"` PublicMetadata interface{} `json:"public_metadata"` PrivateMetadata interface{} `json:"private_metadata"` UnsafeMetadata interface{} `json:"unsafe_metadata"` LastSignInAt *int64 `json:"last_sign_in_at"` Banned bool `json:"banned"` ExternalID *string `json:"external_id"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
type UserDisableMFAResponse ¶ added in v1.21.0
type UserDisableMFAResponse struct {
UserID string `json:"user_id"`
}
type UserOAuthAccessToken ¶ added in v1.31.0
type UsersService ¶
type UsersService service
func (*UsersService) Ban ¶ added in v1.21.0
func (s *UsersService) Ban(userID string) (*User, error)
func (*UsersService) Count ¶ added in v1.4.0
func (s *UsersService) Count(params ListAllUsersParams) (*UserCount, error)
func (*UsersService) Create ¶ added in v1.18.0
func (s *UsersService) Create(params CreateUserParams) (*User, error)
func (*UsersService) Delete ¶
func (s *UsersService) Delete(userId string) (*DeleteResponse, error)
func (*UsersService) DisableMFA ¶ added in v1.21.0
func (s *UsersService) DisableMFA(userID string) (*UserDisableMFAResponse, error)
func (*UsersService) ListAll ¶
func (s *UsersService) ListAll(params ListAllUsersParams) ([]User, error)
func (*UsersService) ListMemberships ¶ added in v1.35.1
func (s *UsersService) ListMemberships(params ListMembershipsParams) (*ListOrganizationMembershipsResponse, error)
func (*UsersService) ListOAuthAccessTokens ¶ added in v1.31.0
func (s *UsersService) ListOAuthAccessTokens(userID, provider string) ([]*UserOAuthAccessToken, error)
func (*UsersService) Unban ¶ added in v1.21.0
func (s *UsersService) Unban(userID string) (*User, error)
func (*UsersService) Update ¶
func (s *UsersService) Update(userId string, updateRequest *UpdateUser) (*User, error)
func (*UsersService) UpdateMetadata ¶ added in v1.9.0
func (s *UsersService) UpdateMetadata(userId string, updateMetadataRequest *UpdateUserMetadata) (*User, error)
type Verification ¶ added in v1.28.0
type Verification struct { Status string `json:"status"` Strategy string `json:"strategy"` Attempts *int `json:"attempts"` ExpireAt *int64 `json:"expire_at"` VerifiedAtClient string `json:"verified_at_client,omitempty"` // needed for Web3 Nonce *string `json:"nonce,omitempty"` // needed for OAuth ExternalVerificationRedirectURL *string `json:"external_verification_redirect_url,omitempty"` Error []byte `json:"error,omitempty"` }
type VerificationService ¶ added in v1.0.3
type VerificationService service
type VerifyTokenOption ¶ added in v1.2.0
type VerifyTokenOption func(*verifyTokenOptions) error
VerifyTokenOption describes a functional parameter for the VerifyToken method
func WithAuthorizedParty ¶ added in v1.2.0
func WithAuthorizedParty(parties ...string) VerifyTokenOption
WithAuthorizedParty allows to set the authorized parties to check against the azp claim of the session token
func WithCustomClaims ¶ added in v1.8.0
func WithCustomClaims(customClaims interface{}) VerifyTokenOption
WithCustomClaims allows to pass a type (e.g. struct), which will be populated with the token claims based on json tags. For this option to work you must pass a pointer.
func WithJWTVerificationKey ¶ added in v1.5.0
func WithJWTVerificationKey(key string) VerifyTokenOption
WithJWTVerificationKey allows to set the JWK to use for verifying tokens without the need to download or cache any JWKs at runtime
func WithLeeway ¶ added in v1.5.0
func WithLeeway(leeway time.Duration) VerifyTokenOption
WithLeeway allows to set a custom leeway that gives some extra time to the token to accomodate for clock skew, etc.
type Web3Wallet ¶ added in v1.31.0
type Web3Wallet struct { ID string `json:"id"` Object string `json:"object"` Web3Wallet string `json:"web3_wallet"` Verification *Verification `json:"verification"` }
type WebhooksService ¶ added in v1.0.8
type WebhooksService service
func (*WebhooksService) CreateSvix ¶ added in v1.1.0
func (s *WebhooksService) CreateSvix() (*SvixResponse, error)
func (*WebhooksService) DeleteSvix ¶ added in v1.1.0
func (s *WebhooksService) DeleteSvix() error
func (*WebhooksService) RefreshSvixURL ¶ added in v1.1.0
func (s *WebhooksService) RefreshSvixURL() (*SvixResponse, error)
type ΟrganizationMembershipPublicUserData ¶ added in v1.32.0
Source Files ¶
- actor_tokens.go
- allowlists.go
- blocklists.go
- clerk.go
- clerk_options.go
- clients.go
- delete_response.go
- email_addresses.go
- emails.go
- errors.go
- instances.go
- jwks.go
- jwks_cache.go
- jwt_templates.go
- middleware.go
- middleware_v2.go
- organizations.go
- phone_numbers.go
- redirect_urls.go
- saml_connections.go
- sessions.go
- sms.go
- templates.go
- tokens.go
- tokens_options.go
- users.go
- verification.go
- web3_wallets.go
- webhooks.go