Fullstack Authorization

Drop-in components and infrastructure to add authorization at every layer of the tech stack, from front-end to back-end.

Client-side Authorization

Drop-in higher-order components for React.js, Next.js, and Vue.js to help you build UIs that are permission-aware and behave dynamically based on each user's access rules.

nextjsNext.jsreactjsReact.jsvuejsVue.jsgithubView All
1//
2// App.jsx
3//
4<WarrantProvider clientKey="<your_client_key>">
5 {/* Routes, ThemeProviders, etc. */}
6</WarrantProvider>;
7
8//
9// MyComponent.jsx
10//
11<ProtectedComponent
12 warrants={[{
13 objectType: "myObject",
14 objectId: object.id,
15 relation: "viewer",
16 }]}
17>
18 <MyComponent/>
19</ProtectedComponent>

Server-side Authorization

SDKs and middleware for the most popular back-end languages & frameworks like Express, Go, Python, Java, and Ruby to add permission checks to your back-end API routes and business logic.

goGojavaJavapythonPythonrubyRubyexpressjsExpress.jsnodejsNode.jsgithubView All
1import "github.com/warrant-dev/warrant-go"
2
3client := warrant.NewClient(warrant.ClientConfig{
4 ApiKey: "<your_api_key>",
5})
6
7isAuthorized, err := client.IsAuthorized(warrant.Warrant{
8 ObjectType: "report",
9 ObjectId: "profits-and-losses",
10 Relation: "viewer",
11 Subject: warrant.Subject{
12 ObjectType: "user",
13 ObjectId: "user.id",
14 },
15})
16
17if isAuthorized {
18 // Carry out authorized logic
19}

Don't see your favorite language or framework?

Join us on Slack and let us know what to add next.

slackJoin Slack