Wrapper and interface for the Stytch B2B SaaS authentication API in Elixir
Together uses the Elixir programming language for several of its services. It also uses Stytch to serve some of its authentication and authorization needs. This repository provides a wrapper around the Stytch B2B SaaS Authentication API in Elixir.
This repository is a work in progress and not necessarily meant for public consumption.
This library is not currently available on Hex.pm, so install it via GitHub and run mix deps.get
:
def deps do
[
{:stytch, github: "togethercomputer/stytch-elixir", branch: "main"}
]
end
Stytch's API uses a project ID and secret for authentication. If your application only interacts with a single project, you can provide these as the default auth for all requests:
config :stytch, :default_auth,
{
"project-live-...",
"secret-live-..."
}
If your application interacts with more than one project, these auth details must be provided in each operation call:
Stytch.Organizations.search(%{}, auth: {"project-live-...", "secret-live-..."})
The client will automatically switch between the test and live API based on the provided project ID and secret.
If your application uses Stytch-provided session JWTs for session management, this library can assist with verification.
See Stytch.JWKS
for more information.
At the time of writing, Stytch does not publish an OpenAPI description for their API. A hand-crafted description is available in this repository. It was generated based on a public Postman collection and enhanced by hand — so don't expect full coverage of the API.
Code generation provided by the OpenAPI Generator for Elixir.
Please see LICENSE for licensing details.