DashboardSign In

Installation

mix.exs
Elixir

Releases

v1.0.0

December 20, 2023
December 20, 2023

Description

This is the first major release of the WorkOS Elixir SDK, it introduces all of the core APIs from WorkOS released until this moment and provides better configuration support for applications.

However, it'll remain as an experimental SDK since we don't have plans to keep it up to date across core product API changes.

Breaking changes compared to previous minor versions

Response structs

For matching clauses like this one:

case WorkOS.Organizations.get_organization(org_id) do
      {:ok,
       %{
         "id" => id,
         "name" => name
       }} 

It might result in a similar "no clause matching" error:

CleanShot 2023-12-09 at 23 43 59

Responses now have their structs that are parsed from the JSON responses. For instance, here's how to perform matching on the result of get_organization with response structs:

{:ok, %WorkOS.Organizations.Organization{id: id}} =
  WorkOS.Organizations.get_organization("org_123")

You may also encounter errors regarding Access Behaviour on Structs.

Configuration

Introducing a new configuration option: :client, by default, this library uses Tesla but it can be replaced according to the WorkOS.Client module behavior.

However, as previously, the only required config options are :api_key and :client_id.

You can also create a client struct separately, and pass it to each method.

client = WorkOS.client(api_key: System.fetch_env!("WORKOS_API_KEY"), client_id: System.fetch_env!("WORKOS_CLIENT_ID"))

WorkOS.Organizations.get_organization(client, "org_123")

Note that if you choose to configure WorkOS in your app config, passing a client struct is always optional.

config :workos, WorkOS.Client,
      api_key: "sk_12345",
      client_id: "project_12345"

Removed

  • Removed deprecated domain option from WorkOS.SSO.get_authorization_url, organization should be used instead.

Added

We're introducing new API modules according to our latest features:

  • WorkOS.OrganizationDomains: https://workos.com/docs/reference/domain-verification
  • WorkOS.UserManagement: https://workos.com/docs/reference/user-management
  • WorkOS.Events: https://workos.com/docs/reference/events

v0.4.0

November 13, 2023
November 13, 2023

Fixed

  • Fixed a bug in create_session causing the expires_in to not be passed in properly #35

v0.3.0

March 8, 2023
March 8, 2023

Added

  • Added Webhooks module to validate webhook requests #28

Fixed

  • Fixed a bug in get_profile causing the access_token to not be passed in properly #29

v0.2.0

December 23, 2022
December 23, 2022

Added

  • Added Audit Logs module (#18)
  • Added MFA module (#22)
  • Added CI Pipeline (#23 and #24)

Updated

  • Minor code improvements (#14)
  • Refactored Portal module and added Organizations module (#17)
  • Updated SSO module (#19)
  • Updated Directory Sync module (#25)

Fixed

  • Converted organization to organization_id in Audit Logs module (#20)
  • Fixed usage of opts in API and SSO modules (#21)

v0.1.1

February 12, 2021
February 12, 2021
  • Updated the configuration to support auto-generating docs for the hex package

v0.1.0

February 10, 2021
February 10, 2021

This is an initial beta version release.

This includes support for:

  • Passwordless
  • SSO
  • Portal
  • Directory Sync

v0.1.3

May 17, 2022
May 17, 2022
  • Added delete directory method (#3)
  • Upgradeed hackney and add delete organization in (#5)
  • Added connection param to passwordless (#7)
  • Fixed test warning and update deps (#9)

v0.1.2

April 20, 2021
April 20, 2021
  • Added connection to get_authorization_url (#1)