Quickstart
Follow these steps to get started with Warrant, from account creation to creating and enforcing rules in < 10 minutes.
Create an account
- First, create an account for your organization.
- Once you're logged in, you can view your API keys and invite your teammates.
- The dashboard lets you view and manage your entire authorization model, including your object types, warrants, users, tenants and environments.
note
If a Warrant account already exists for your organization, please ask your account admin to invite you directly from the dashboard.
Create your access model
Use our built-in object types for RBAC, multitenancy or pricing tiers and feature entitlements or build your own model.
Install & configure SDK(s)
The primary way to interact with Warrant is via the REST APIs. You can call API endpoints directly (API reference) or use one of the official open-source SDKs in your applications:
Back-end (server-side)
- Go
- Node.js
- Python
- Java
- Ruby
- PHP
Install the Go SDK
go get github.com/warrant-dev/warrant-go/v5
Use it in an application
import (
"github.com/warrant-dev/warrant-go/v5"
)
client := warrant.NewClient(config.ClientConfig{
ApiKey: "YOUR_KEY"
})
Install the Node SDK
npm install @warrantdev/warrant-node
Use it in an application
import { WarrantClient } from "@warrantdev/warrant-node";
const warrantClient = new WarrantClient({
apiKey: "YOUR_KEY",
});
Install the Python SDK
pip install warrant-python
Use it in an application
import warrant
warrant.api_key = "YOUR_KEY"
Install the Java SDK (Gradle)
implementation group: 'dev.warrant', name: 'warrant-java', version: 'x.x.x'
Install the Java SDK (Maven)
<dependency>
<groupId>dev.warrant</groupId>
<artifactId>warrant-java</artifactId>
<version>x.x.x</version>
</dependency>
Use it in an application
import dev.warrant.*;
WarrantClient client = new WarrantClient(WarrantConfig.withApiKey("YOUR_KEY"));
Install the Ruby SDK
gem install warrant
Use it in an application
require 'warrant'
Warrant.api_key = 'YOUR_KEY'
Install the PHP SDK
composer require warrant-dev/warrant-php
Use it in an application
$warrant = new \Warrant\Client(
new \Warrant\Config("YOUR_KEY")
);
Front-end (client-side)
- React
- Vue
- Angular
Install the React SDK
npm install @warrantdev/react-warrant-js
Use it in an application
// App.jsx
import React from "react";
import { WarrantProvider } from "@warrantdev/react-warrant-js";
const App = () => {
return (
<WarrantProvider clientKey="CLIENT_KEY">
{/* Routes, ThemeProviders, etc. */}
</WarrantProvider>
);
};
export default App;
Install the Vue SDK
npm install @warrantdev/vue-warrant
Use it in an application
// main.js
import Vue from "vue";
import router from "./router";
import App from "./App.vue";
import { Warrant } from "@warrantdev/vue-warrant";
Vue.config.productionTip = false;
Vue.use(Warrant, {
clientKey: "CLIENT_KEY",
});
new Vue({
router,
// store,
render: (h) => h(App),
}).$mount("#app");
Install the Angular SDK
npm install @warrantdev/angular-warrant
Use it in an application
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { AppComponent } from "./app.component";
// Import the module from the SDK
import { WarrantModule } from "angular-warrant";
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
// Import the module into the application, with configuration
WarrantModule.forRoot({
clientKey: "CLIENT_KEY",
}),
],
bootstrap: [AppComponent],
})
export class AppModule {}
Integrate with your application
Now that you've set up an account, your access model, and SDK(s), you can integrate Warrant into your application:
- Create and delete warrants
- Check access
- Query access