Skip to content

kinde-oss/kinde-go

Repository files navigation

Kinde Go SDK

This is work in progress. API is subject to change without warning.

The Kinde SDK for Go.

PRs Welcome Kinde Docs Kinde Community

Development

Requires Go 1.21+

Usage

go get github.com/kinde-oss/kinde-go
go mod tidy

Autorization code flow

import (
	"github.com/kinde-oss/kinde-go/jwt"
	"github.com/kinde-oss/kinde-go/oauth2/authorization_code"
)

Example is in the test: authorization_code_test.go

Client credentials flow

import (
	"github.com/kinde-oss/kinde-go/jwt"
	"github.com/kinde-oss/kinde-go/oauth2/client_credentials"
)

Example is in the test: client_credentials_test.go

Manually requesting a token

	token, err := kindeClient.GetToken(context.Background())

Using client to request an API endpoint

  //This client will cache the token and re-fetch a new one as it expires
  client := kindeClient.GetClient(context.Background())

  //example call to Kinde Management API (client needs WithKindeManagementAPI(...))
  businessDetails, err := client.Get(fmt.Sprintf("%v/api/v1/business.json", os.Getenv("KINDE_SUB_DOMAIN")))

SDK Development

  1. Clone the repository to your machine:

    git clone https://github.com/kinde-oss/kinde-go.git
  2. Go into the project:

    cd kinde-go
  3. Install the dependencies:

    go mod download

Documentation

For details on integrating this SDK into your project, head over to the Kinde docs and see the Go SDK doc 👍🏼.

Publishing

The core team handles publishing.

Contributing

Please refer to Kinde’s contributing guidelines.

License

By contributing to Kinde, you agree that your contributions will be licensed under its MIT License.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages