Grammarly OAuth

Grammarly OAuth handling

Hi, so I am working on integrating the premium features of Grammarly by adding OAuth for people to connect their accounts. I have setup everything from reading the Grammarly docs here And have cloned the repo from the person that initially started creating the plugin. I feel that I am very close to solving this. I have looked at other posts where they are handling OAuth from this google photos and evernote. And looking at their code on GitHub it seems they both have a URL to call for OAuth, but when I use the Grammarly tool, it is pre-built when you enable it on your Grammarly app instance.


So the only new thing I added to the initial code was a redirect uri, which seems to work well. Because it takes me through the flow without any errors to my knowledge. And in the obsidian console, I am getting this message.

Which I think is from my redirect uri I set here:

host?.setAttribute("config.oauthRedirectUri", "obsidian://open?");

So from the console log, are those the creds that Grammarly is sending back? Or is this just opening the app?

Do I need to add an event listener for users clicking on the Connect your Grammarly account? I know I am missing something fundamental to OAuth.

I would appreciate any advice. This is my first time doing a plugin and open source.


From the docs, it looks like Grammarly has made it much easier than the Google Photos integration.

In the Redirect URIs (desktop clients) it looks like you can use an obsidian:// URL as you’ve noted, so as part of your plugin you need to register a protocol handler and then use that to handle the callback from Grammarly.


This was exactly what I needed. Thank you! I got it working.


Do share when its completely done. I would like to try it

1 Like

same here!