We used Supabase API to login through a social provider (Notion in our case, obviously). It turns out that whilst logging into Supabase through Notion, Supabase also yields the provider (Notion) token in case we need to interact with the provider's API afterwards.
We do need to interact with Notion's API. So we need to store that API token for later use.
Solution
It's simple enough, thanks to Plasmo's storage utility. We just store the whole payload sent by Supabase upon authentication. Notion's API token is in there somewhere, under the provider_token key.
Context
We used Supabase API to login through a social provider (Notion in our case, obviously). It turns out that whilst logging into Supabase through Notion, Supabase also yields the provider (Notion) token in case we need to interact with the provider's API afterwards.
We do need to interact with Notion's API. So we need to store that API token for later use.
Solution
It's simple enough, thanks to Plasmo's storage utility. We just store the whole payload sent by Supabase upon authentication. Notion's API token is in there somewhere, under the
provider_token
key.