Notion Integration

I’m looking into how I can integrate with Notion. I would like the app to allow users to integrate with their own notion accounts. They should be able to allow access to the contents on their notion pages.

I’ve been looking at creating a custom Zapier Integration with Notion to a weweb app. Viewed the Notion Weweb youtube live. But I’m not sure where to go about an integration for my users not for myself.

I’m at a point where I have setup supabase = supabasee auth for user registration and login.

Any direction or advice would be greatly appreciated!

what you are looking for is probably a public notion integration.
You can read more about it in the notion developers doc to start understanding what you need.

@dorilama Thanks for the reference. I’m getting to a point where I’m able to achieve authorization through the notion integration i setup using supabase provider login with notion. The challenge I’m having is, after the notion login page and notion page access selection, I’m redirected back to my weweb project dashboard, rather than the page of my app. How can I ensure that a user will be redirected to the intended page within the app I’m building without publishing the app yet?

you will need to specify the right url for the redirect.
before you publish you should know what the final url will be

ok awesome! thanks @dorilama ! and last question (for now atleast)

I’ve been following this article:

The part where is says:

Click on Allow access and you should be redirected to your redirect_uri.

If users allow access, they’ll also be redirected to your redirect_uri with a temporary authorization code. It will look something like this:

|--- Your redirect URL --| |--- The temporary authorization code ---|

Where is the code and how can I store that in weweb to make requests with?

As you can read in the example, the code is in the url.

You may want to redirect to an endpoint of your backend instead of a page on your frontend, otherwise the temporary code will be accessible to any script that runs on your page (eg. any third party script you load)

i am currently redirecting to an endpoint of supabase.
Though I am having trouble calling the Notion API with the access token Supabase receives.

On another thread I found this:

This should be available in the session from the onAuthStateChange method, the property is called provider_token , so you can retrieve it like:

supabase.auth.onAuthStateChange((event, session) => {
  const providerToken = session?.provider_token;

Not sure how to retrieve this within weweb. Any suggestions?

@dorilama any clue what I can do on the weweb side to use this method?

Hi, you can try to access the user session this way


You should be able to retrieve the current user session and then see the provider_token. :slight_smile:


@Alexis Thanks Alexis! This did the trick! exactly what I needed. Would be great to get this folded into some of the documentation. Wasn’t sure that this method existed in the wwLib for supabase plugin.