Versions in this module Expand all Collapse all v2 v2.0.0 Nov 11, 2022 Changes in this version + const ActiveSession + const ActiveSessionClaims + const ActorTokensUrl + const AllowlistsUrl + const BlocklistsUrl + const ClientsUrl + const ClientsVerifyUrl + const CookieSession + const EmailAddressesURL + const EmailsUrl + const InvitationsURL + const JWTTemplatesUrl + const OrganizationsUrl + const PhoneNumbersURL + const ProdUrl + const QueryParamSessionId + const RedirectURLsUrl + const SMSUrl + const SessionsUrl + const TemplatesUrl + const UsersCountUrl + const UsersUrl + const WebhooksUrl + 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 struct + Actor json.RawMessage + CreatedAt int64 + ID string + Object string + Status string + Token string + UpdatedAt int64 + UserID string + type ActorTokenService service + func (s *ActorTokenService) Create(params CreateActorTokenParams) (*ActorTokenResponse, error) + func (s *ActorTokenService) Revoke(actorTokenID string) (*ActorTokenResponse, error) + type AllowlistIdentifierResponse struct + CreatedAt int64 + ID string + Identifier string + IdentifierType string + InvitationID string + Object string + UpdatedAt int64 + type AllowlistIdentifiersResponse struct + Data []*AllowlistIdentifierResponse + TotalCount int64 + type AllowlistsService service + func (s *AllowlistsService) CreateIdentifier(params CreateAllowlistIdentifierParams) (*AllowlistIdentifierResponse, error) + func (s *AllowlistsService) DeleteIdentifier(identifierID string) (*DeleteResponse, error) + func (s *AllowlistsService) ListAllIdentifiers() (*AllowlistIdentifiersResponse, error) + type BlocklistIdentifierResponse struct + CreatedAt int64 + ID string + Identifier string + IdentifierType string + Object string + UpdatedAt int64 + type BlocklistIdentifiersResponse struct + Data []*BlocklistIdentifierResponse + TotalCount int64 + type BlocklistsService service + func (s *BlocklistsService) CreateIdentifier(params CreateBlocklistIdentifierParams) (*BlocklistIdentifierResponse, error) + func (s *BlocklistsService) DeleteIdentifier(identifierID string) (*DeleteResponse, error) + func (s *BlocklistsService) ListAllIdentifiers() (*BlocklistIdentifiersResponse, error) + type ClerkOption func(*client) error + func WithBaseURL(rawURL string) ClerkOption + func WithHTTPClient(httpClient *http.Client) ClerkOption + type Client interface + APIKey func() string + ActorTokens func() *ActorTokenService + Allowlists func() *AllowlistsService + Blocklists func() *BlocklistsService + Clients func() *ClientsService + DecodeToken func(token string) (*TokenClaims, error) + Do func(req *http.Request, v interface{}) (*http.Response, error) + EmailAddresses func() *EmailAddressesService + Emails func() *EmailService + Instances func() *InstanceService + Interstitial func() ([]byte, error) + JWKS func() *JWKSService + JWTTemplates func() *JWTTemplatesService + NewRequest func(method, url string, body ...interface{}) (*http.Request, error) + Organizations func() *OrganizationsService + PhoneNumbers func() *PhoneNumbersService + RedirectURLs func() *RedirectURLsService + SMS func() *SMSService + Sessions func() *SessionsService + Templates func() *TemplatesService + Users func() *UsersService + Verification func() *VerificationService + VerifyToken func(token string, opts ...VerifyTokenOption) (*SessionClaims, error) + Webhooks func() *WebhooksService + func NewClient(token string, options ...ClerkOption) (Client, error) + func NewClientWithBaseUrl(token, baseUrl string) (Client, error) + func NewClientWithCustomHTTP(token, urlStr string, httpClient *http.Client) (Client, error) + type ClientResponse struct + Ended bool + ID string + LastActiveSessionID *string + Object string + SessionIDs []string + Sessions []*Session + SignInAttemptID *string + SignUpAttemptID *string + type ClientsService service + func (s *ClientsService) ListAll() ([]ClientResponse, error) + func (s *ClientsService) Read(clientId string) (*ClientResponse, error) + func (s *ClientsService) Verify(token string) (*ClientResponse, error) + type CreateActorTokenParams struct + Actor json.RawMessage + ExpiresInSeconds *int + SessionMaxDurationInSeconds *int + UserID string + type CreateAllowlistIdentifierParams struct + Identifier string + Notify bool + type CreateBlocklistIdentifierParams struct + Identifier string + type CreateEmailAddressParams struct + EmailAddress string + Primary *bool + UserID string + Verified *bool + type CreateOrganizationInvitationParams struct + EmailAddress string + InviterUserID string + OrganizationID string + PublicMetadata json.RawMessage + RedirectURL string + Role string + type CreateOrganizationParams struct + CreatedBy string + MaxAllowedMemberships *int + Name string + PrivateMetadata json.RawMessage + PublicMetadata json.RawMessage + Slug *string + type CreatePhoneNumberParams struct + PhoneNumber string + Primary *bool + UserID string + Verified *bool + type CreateRedirectURLParams struct + URL string + type CreateUpdateJWTTemplate struct + AllowedClockSkew *int + Claims map[string]interface{} + CustomSigningKey bool + Lifetime *int + Name string + SigningAlgorithm *string + SigningKey *string + type CreateUserParams struct + BackupCodes []string + EmailAddresses []string + FirstName *string + LastName *string + Password *string + PasswordDigest *string + PasswordHasher *string + PhoneNumbers []string + PrivateMetadata *json.RawMessage + PublicMetadata *json.RawMessage + TOTPSecret *string + UnsafeMetadata *json.RawMessage + Username *string + Web3Wallets []string + type DeleteResponse struct + Deleted bool + ID string + Object string + Slug string + type Email struct + Body string + EmailAddressID string + FromEmailName string + Subject string + type EmailAddress struct + EmailAddress string + ID string + LinkedTo []IdentificationLink + Object string + Reserved bool + Verification *Verification + type EmailAddressesService service + 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 struct + Data json.RawMessage + DeliveredByClerk bool + ID string + Object string + Status string + ToEmailAddress *string + type EmailService service + func (s *EmailService) Create(email Email) (*EmailResponse, error) + type Error struct + Code string + LongMessage string + Message string + Meta interface{} + type ErrorResponse struct + Errors []Error + Response *http.Response + func (e *ErrorResponse) Error() string + type IdentificationLink struct + IdentID string + IdentType string + type InstanceRestrictionsResponse struct + Allowlist bool + Blocklist bool + Object string + type InstanceService service + func (s *InstanceService) Update(params UpdateInstanceParams) error + func (s *InstanceService) UpdateOrganizationSettings(params UpdateOrganizationSettingsParams) (*OrganizationSettingsResponse, error) + func (s *InstanceService) UpdateRestrictions(params UpdateRestrictionsParams) (*InstanceRestrictionsResponse, error) + type JWKS jose.JSONWebKeySet + type JWKSService service + func (s *JWKSService) ListAll() (*JWKS, error) + type JWTTemplate struct + AllowedClockSkew int + Claims json.RawMessage + CreatedAt int64 + CustomSigningKey bool + ID string + Lifetime int + Name string + Object string + SigningAlgorithm string + UpdatedAt int64 + type JWTTemplatesService service + 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 struct + IncludeMembersCount bool + Limit *int + Offset *int + type ListAllUsersParams struct + EmailAddresses []string + Limit *int + Offset *int + OrderBy *string + PhoneNumbers []string + Query *string + UserIDs []string + Usernames []string + Web3Wallets []string + type Organization struct + CreatedAt int64 + ID string + LogoURL *string + MaxAllowedMemberships int + MembersCount *int + Name string + Object string + PrivateMetadata json.RawMessage + PublicMetadata json.RawMessage + Slug *string + UpdatedAt int64 + type OrganizationInvitation struct + CreatedAt int64 + EmailAddress string + ID string + Object string + OrganizationID string + PublicMetadata json.RawMessage + Role string + Status string + UpdatedAt int64 + type OrganizationSettingsResponse struct + Enabled bool + MaxAllowedMemberships int + Object string + type OrganizationsResponse struct + Data []Organization + TotalCount int64 + type OrganizationsService service + func (s *OrganizationsService) Create(params CreateOrganizationParams) (*Organization, error) + func (s *OrganizationsService) CreateInvitation(params CreateOrganizationInvitationParams) (*OrganizationInvitation, error) + func (s *OrganizationsService) Delete(organizationID string) (*DeleteResponse, error) + func (s *OrganizationsService) ListAll(params ListAllOrganizationsParams) (*OrganizationsResponse, error) + func (s *OrganizationsService) Update(organizationID string, params UpdateOrganizationParams) (*Organization, error) + type PhoneNumber struct + BackupCodes []string + DefaultSecondFactor bool + ID string + LinkedTo []IdentificationLink + Object string + PhoneNumber string + Reserved bool + ReservedForSecondFactor bool + Verification *Verification + type PhoneNumbersService service + 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 struct + Body string + FromEmailName *string + Subject string + type RedirectURLResponse struct + CreatedAt int64 + ID string + Object string + URL string + UpdatedAt int64 + type RedirectURLsService service + func (s *RedirectURLsService) Create(params CreateRedirectURLParams) (*RedirectURLResponse, error) + func (s *RedirectURLsService) Delete(redirectURLID string) (*DeleteResponse, error) + func (s *RedirectURLsService) ListAll() ([]*RedirectURLResponse, error) + type SMSMessage struct + Message string + PhoneNumberID string + type SMSMessageResponse struct + Data json.RawMessage + DeliveredByClerk bool + FromPhoneNumber string + ID string + Object string + Status string + ToPhoneNumber *string + type SMSService service + func (s *SMSService) Create(message SMSMessage) (*SMSMessageResponse, error) + type Session struct + AbandonAt int64 + ClientID string + ExpireAt int64 + ID string + LastActiveAt int64 + Object string + Status string + UserID string + type SessionClaims struct + ActiveOrganizationID string + ActiveOrganizationRole string + ActiveOrganizationSlug string + AuthorizedParty string + SessionID string + func SessionFromContext(ctx context.Context) (*SessionClaims, bool) + type SessionsService service + func (s *SessionsService) ListAll() ([]Session, error) + func (s *SessionsService) Read(sessionId string) (*Session, error) + func (s *SessionsService) Revoke(sessionId string) (*Session, error) + func (s *SessionsService) Verify(sessionId, token string) (*Session, error) + type SvixResponse struct + SvixURL string + type Template struct + CanDelete bool + CanRevert bool + CreatedAt int64 + DeliveredByClerk bool + FromEmailName *string + Name string + Object string + Position int + ResourceType string + Slug string + TemplateType string + UpdatedAt int64 + type TemplateExtended struct + AvailableVariables []string + Body string + Markup string + RequiredVariables []string + Subject string + type TemplatePreview struct + Body string + FromEmailAddress *string + Subject string + type TemplatesService service + 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 struct + Extra map[string]interface{} + type UpdateEmailAddressParams struct + Primary *bool + Verified *bool + type UpdateInstanceParams struct + ClerkJSVersion *string + EnhancedEmailDeliverability *bool + HIBP *bool + SupportEmail *string + TestMode *bool + type UpdateOrganizationParams struct + MaxAllowedMemberships *int + Name *string + type UpdateOrganizationSettingsParams struct + Enabled *bool + MaxAllowedMemberships *int + type UpdatePhoneNumberParams struct + Primary *bool + Verified *bool + type UpdateRestrictionsParams struct + Allowlist *bool + Blocklist *bool + type UpdateUser struct + BackupCodes []string + FirstName *string + LastName *string + Password *string + PrimaryEmailAddressID *string + PrimaryPhoneNumberID *string + PrivateMetadata interface{} + ProfileImage *string + PublicMetadata interface{} + TOTPSecret *string + UnsafeMetadata interface{} + type UpdateUserMetadata struct + PrivateMetadata interface{} + PublicMetadata interface{} + UnsafeMetadata interface{} + type UpsertTemplateRequest struct + Body string + DeliveredByClerk *bool + FromEmailName *string + Markup string + Name string + Subject string + type User struct + BackupCodeEnabled bool + Banned bool + Birthday *string + CreatedAt int64 + EmailAddresses []EmailAddress + ExternalAccounts []interface{} + FirstName *string + Gender *string + ID string + LastName *string + LastSignInAt *int64 + Object string + PasswordEnabled bool + PhoneNumbers []PhoneNumber + PrimaryEmailAddressID *string + PrimaryPhoneNumberID *string + PrivateMetadata interface{} + ProfileImageURL string + PublicMetadata interface{} + TOTPEnabled bool + TwoFactorEnabled bool + UnsafeMetadata interface{} + UpdatedAt int64 + Username *string + type UserCount struct + Object string + TotalCount int + type UserDisableMFAResponse struct + UserID string + type UsersService service + 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) 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 struct + Attempts *int + Error []byte + ExpireAt *int64 + ExternalVerificationRedirectURL *string + Nonce *string + Status string + Strategy string + VerifiedAtClient string + type VerificationService service + func (s *VerificationService) Verify(req *http.Request) (*Session, error) + type VerifyTokenOption func(*verifyTokenOptions) error + func WithAuthorizedParty(parties ...string) VerifyTokenOption + func WithCustomClaims(customClaims interface{}) VerifyTokenOption + func WithJWTVerificationKey(key string) VerifyTokenOption + func WithLeeway(leeway time.Duration) VerifyTokenOption + type WebhooksService service + func (s *WebhooksService) CreateSvix() (*SvixResponse, error) + func (s *WebhooksService) DeleteSvix() error + func (s *WebhooksService) RefreshSvixURL() (*SvixResponse, error) Other modules containing this package github.com/clerkinc/clerk-sdk-go