Simplify authentication and monetisation with Clerk and Salable

When it comes to rapidly implementing secure authentication in your application, it doesn't get much simpler than Clerk. Create an account, implement some pre-built components, and you're done!

So you've now got authentication, but you wanted to make a paid product - what next? This is where Salable comes into the picture.

Salable is a platform that allows you to implement flexible licensing/monetisation without all of the headaches. We make it simple to take payments and authorise users in your system.

Clerk allows you to implement auth in hours instead of days, Salable aims to do the same with licensing and payments.

And guess what? They fit together like two peas in a pod.

In Salable, we have the concept of a **Grantee** — this is anything/anyone that you'd want a license to belong to. It could be a team, it could be an individual user, it could be a Trello board, anything!

Clerk provides us with a `userId` for our authenticated user. Here is an example of fetching it using the `@clerk/clerk-react` package:


import { useUser } from '@clerk/clerk-react'const { user } = useUser()const granteeId = user.id


We can now use this `granteeId` value with any of the Salable SDKs (or our REST API) to start accepting payments.

Let's look at an example of checking a user's license capabilities with `@salable/js`:



import { getGrantee } from '@salable/js';
const { hasCapability } = await getGrantee({  
apiKey: 'your-salable-api-key',  
productUuid: 'your-products-uuid',  
granteeId, // 💡 this is using the `user.id` from Clerk
});
const isUserLicensedToPerformAction = hasCapability('your-capability-name');

And that is all there is to it. You can now use your Clerk authentication setup to accept payments and run license checks for authenticated users.

To learn more about what methods and functionality Salable offers, check out our documentation site.

For any questions on any Clerk and Salable integration tips and tricks, you can visit our Discord channel.

Related blogs

Tweet from Neal Riley saying "Commercial freedom and flexibility is a must for any digitally enabled business. @SalableApp gives you the tools to build your SaaS business."

Tweet from Neal Riley saying "Commercial freedom and flexibility is a must for any digitally enabled business. @SalableApp gives you the tools to build your SaaS business."

Creating and monetising a Trello Power-Up using Salable!

In this post, we’re going to look at how you can go about creating a new Trello Power-Up and monetise it using Salable so you can easily charge users to get access to...

Coner Murphy
27 Oct 2023

Beyond payments: Salable's flexible, insightful monetisation solutions

You know, it's not just about crafting an awesome app (though that's super important, of course). It's also about figuring out how to sell it, how to license it...

Jyoti Jaswani
01 Mar 2024

Easily monetise your Remix application with Salable

In this guide, I'm going to showcase just how easy it is to monetise web applications built using the [Remix.run](https://remix.run) framework...

Luke Glazebrook
10 Nov 2023

Sign up to
our mailing list

Stay up to date with what we are currently building, plus new features, and chances to enter competitions.