Skip to content

Latest commit

 

History

History
 
 

example

Lichess OAuth examples

There are multiple ways to connect to the Lichess API, depending on your needs.

Which authentication is right for you?

Personal token

This is the simplest way, but it requires manually creating a token.

It's the preferred way if you're only writing a client for yourself, or if the users of your client are few, and tech-savvy.

Examples:

Never use this for an app that will be used by multiple users. Never share your personal token.

Relevant code example: oauth-personal-token

Login with Lichess, with a web server backend

Authenticate your users with a simple "Login with Lichess" button, if you have a webserver. This allows you to make requests to Lichess on behalf of your app users. It is safe, and scales very well with many users.

Examples:

Relevant code example: oauth-backend

Login with Lichess, without a web server backend

Authenticate your users with a simple "Login with Lichess" button, if you don't have a webserver. Perfectly suited to mobile apps, CLI apps, client-side JS apps.

This allows you to make requests to Lichess on behalf of your app users. It is safe, and scales very well with many users.

Examples:

Relevant code example: oauth-app

No authentication

Many endpoints of the Lichess API don't require any authentication.