-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(add) docs project to the monorepo apps
- Loading branch information
Showing
175 changed files
with
37,504 additions
and
9,347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
``` | ||
$ USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
id: addresses | ||
title: Addresses | ||
description: Create update and delete addresses using via API. | ||
tags: | ||
- GraphQL | ||
--- | ||
|
||
# Manage addresses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
id: authentication | ||
title: Authentication | ||
description: Manage you API keys to authenticate requests to Karrio. | ||
tags: | ||
- Authentication | ||
--- | ||
|
||
import Tabs from "@theme/Tabs"; | ||
import TabItem from "@theme/TabItem"; | ||
|
||
**Manage your API keys to authenticate requests with Karrio.** | ||
|
||
Karrio authenticates your API requests using your account’s API keys. | ||
If you don’t include your key when making an API request, or use an | ||
incorrect or outdated one, Karrio returns an error. | ||
|
||
There are two types of keys: a private key and a JSON Web Token. | ||
|
||
- Private You must keep your private API keys confidential and only | ||
store them on your own servers. You must not share your private API | ||
key with any third parties. Your account’s private API key can perform | ||
any API request to Karrio without restriction. If Karrio believes that | ||
your secret API key has been compromised, you may cancel and reissue it. | ||
- JSON Web Token aka JWT are meant solely to identify your account with | ||
Karrio, they aren’t secret. In other words, you can safely publish them | ||
in places like your karrio.js JavaScript code, or in an Android or iPhone app. | ||
|
||
## Obtaining your API keys | ||
|
||
- Your Private API key is always available in the [Dashboard](https://app.karrio.io/developers/api): | ||
|
||
<img style={{ borderRadius: 5 }} src="/img/assets/api-key.png" width="90%" /> | ||
|
||
- The JSON Web Token on the other hand are obtained by API request | ||
|
||
<div id="tabs"> | ||
<Tabs> | ||
<TabItem value="curl" label="cURL"> | ||
|
||
```shell | ||
curl --request POST \\ | ||
--url https://api.karrio.io/api/token \\ | ||
--header 'Content-Type: application/json' \\ | ||
--data '{ | ||
"email": "admin@example.com", | ||
"password": "demo" | ||
}' | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="js" label="Javascript"> | ||
|
||
```javascript | ||
const karrio = Karrio(); | ||
const token = await karrio.api.authenticate({ | ||
email: "admin@example.com", | ||
password: "demo", | ||
}); | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
</div> | ||
|
||
Karrio returns an key pair object in response to your API request. | ||
|
||
```json | ||
{ | ||
"refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTYzNjYxMzY4NSwiaWF0IjoxNjM2MTgxNjg1LCJqdGkiOiIwNjM1ZGQ4NWExMWU0NTNjYTk2ZTk3NDM4ZDBjOTRkMiIsInVzZXJfaWQiOjF9.1MO8ODXIPvEQtTJdiyyFT1UA54hZnLjrVj8a3DEDbbw", | ||
"access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjM2MTgyNTg1LCJpYXQiOjE2MzYxODE2ODUsImp0aSI6ImMyYWI5YTAzNTRkYTRlZTQ5ZjQ1ZDdlMmI4NWQ5ZGZkIiwidXNlcl9pZCI6MX0.X-MA-9Vi_zWJfvMWSaL8dNj7XOy8kPNz16gvbciLCIM" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
id: batches | ||
title: Batches | ||
description: Use the batch API to create multiple objects at once. | ||
tags: | ||
- REST API | ||
--- |
Oops, something went wrong.