mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Improve SDK, quickstart, token, features docs
This commit is contained in:
@@ -34,6 +34,7 @@ services:
|
|||||||
env_file: .env
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
- NODE_ENV=development
|
||||||
|
- MONGO_URL=mongodb://root:example@mongo:27017/?authSource=admin
|
||||||
networks:
|
networks:
|
||||||
- infisical-dev
|
- infisical-dev
|
||||||
|
|
||||||
@@ -65,8 +66,8 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
env_file: .env
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME}
|
- MONGO_INITDB_ROOT_USERNAME=root
|
||||||
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
|
- MONGO_INITDB_ROOT_PASSWORD=example
|
||||||
volumes:
|
volumes:
|
||||||
- mongo-data:/data/db
|
- mongo-data:/data/db
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -1,26 +1,21 @@
|
|||||||
---
|
---
|
||||||
title: "Infisical Token"
|
title: "Infisical Token"
|
||||||
description: "Use Infisical service token as one of the authentication methods."
|
description: "Use the Infisical Token as one of the authentication methods."
|
||||||
---
|
---
|
||||||
|
|
||||||
An Infisical Token is needed to authenticate the CLI when there isn't an easy way to input your login credentials.
|
An Infisical Token is useful for:
|
||||||
|
|
||||||
It's useful for your CI/CD environments and integrations such as [Docker](/integrations/platforms/docker) and [Docker Compose](/integrations/platforms/docker-compose).
|
- Authenticating the [Infisical CLI](/cli/overview) when there isn't an easy way to input your login credentials.
|
||||||
|
- Granting the [Infisical SDKs](/sdks/overview) access to secrets scoped to a project and environment.
|
||||||
|
|
||||||
|
It's also useful for CI/CD environments and integrations such as [Docker](/integrations/platforms/docker) and [Docker Compose](/integrations/platforms/docker-compose).
|
||||||
|
|
||||||
To generate the the token, head over to your project settings as shown below.
|
To generate the the token, head over to your project settings as shown below.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Feeding Infisical Token to the CLI
|
## Feeding Infisical Token to the CLI
|
||||||
|
|
||||||
The Infisical CLI checks for the presence of an environment variable called `INFISICAL_TOKEN`.
|
The Infisical CLI checks for the presence of an environment variable called `INFISICAL_TOKEN`.
|
||||||
If it detects this variable in the terminal where it is being run, it will use it to authenticate and retrieve the environment variables that the token is authorized to access.
|
If it detects this variable in the terminal where it is being run, it will use it to authenticate and retrieve the environment variables that the token is authorized to access.
|
||||||
This allows you to use the CLI in environments where you are unable to run the `infisical login` command.
|
This allows you to use the CLI in environments where you are unable to run the `infisical login` command.
|
||||||
|
|
||||||
<Note>
|
|
||||||
The token grants read-only access to a particular environment and project for
|
|
||||||
a specified amount of time. Once the token is expired, the CLI using it will no longer be able to make
|
|
||||||
requests with it.
|
|
||||||
</Note>
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: "Features"
|
title: "Features"
|
||||||
description: "A list of features that Infisical has to offer."
|
description: "A non-exhaustive list of features that Infisical has to offer."
|
||||||
---
|
---
|
||||||
|
|
||||||
This is a non-exhaustive list of features that Infisical offers:
|
|
||||||
|
|
||||||
## Platform
|
## Platform
|
||||||
|
|
||||||
- Provision members access to organizations and projects.
|
- Provision members access to organizations and projects.
|
||||||
@@ -16,29 +14,17 @@ This is a non-exhaustive list of features that Infisical offers:
|
|||||||
|
|
||||||
## CLI
|
## CLI
|
||||||
|
|
||||||
The CLI is used to inject environment variables into applications and infrastructure.
|
The [CLI](/cli/overview) is used to inject environment variables into applications and infrastructure.
|
||||||
|
|
||||||
- Inject environment variables.
|
- Inject environment variables.
|
||||||
- Inject environment variables into containers via service tokens for Docker.
|
- Inject environment variables into containers via service tokens for Docker.
|
||||||
|
|
||||||
|
## SDKs
|
||||||
|
|
||||||
|
[SDKs](/sdks/overview) enable apps to fetch back secrets using an [Infisical Token](/getting-started/dashboard/token) scoped to a project and environment.
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
We're building the future of secret management, one that's comprehensive and accessible to all. Some high-level features we have in mind:
|
We're building the future of secret management, one that's comprehensive and accessible to all. Check out our [roadmap](https://www.notion.so/infisical/be2d2585a6694e40889b03aef96ea36b?v=5b19a8127d1a4060b54769567a8785fa).
|
||||||
|
|
||||||
| Feature | Status |
|
|
||||||
| ------------------------------------- | ----------- |
|
|
||||||
| Account recovery: Backup key | Done |
|
|
||||||
| 2FA | Done |
|
|
||||||
| Read/write access controls | Done |
|
|
||||||
| Comparing secrets across environments | Done |
|
|
||||||
| Integrations | Ongoing |
|
|
||||||
| More hosting options | Ongoing |
|
|
||||||
| 1-Click Deploys | Ongoing |
|
|
||||||
| Access logs | Ongoing |
|
|
||||||
| Account recovery: Member-assisted | Coming soon |
|
|
||||||
| Slack & MS teams integrations | Coming soon |
|
|
||||||
| Version control for secrets | Coming soon |
|
|
||||||
| Restricted IPs | Coming soon |
|
|
||||||
| Secret rotation | Coming soon |
|
|
||||||
|
|
||||||
Interested in contributing? Check out the [guide](/contributing/overview).
|
Interested in contributing? Check out the [guide](/contributing/overview).
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ Start syncing environment variables with [Infisical Cloud](https://app.infisical
|
|||||||
<Card href="/cli/overview" title="CLI" icon="square-terminal" color="#16a34a">
|
<Card href="/cli/overview" title="CLI" icon="square-terminal" color="#16a34a">
|
||||||
Install the CLI to inject secrets into apps and infra.
|
Install the CLI to inject secrets into apps and infra.
|
||||||
</Card>
|
</Card>
|
||||||
|
<Card href="/sdks/overview" title="SDKs" icon="puzzle-piece" color="#16a34a">
|
||||||
|
Install an SDK into your app to fetch secrets.
|
||||||
|
</Card>
|
||||||
<Card
|
<Card
|
||||||
href="/self-hosting/overview"
|
href="/self-hosting/overview"
|
||||||
title="Self-hosting"
|
title="Self-hosting"
|
||||||
@@ -37,7 +40,14 @@ Start syncing environment variables with [Infisical Cloud](https://app.infisical
|
|||||||
</Card>
|
</Card>
|
||||||
</CardGroup>
|
</CardGroup>
|
||||||
|
|
||||||
|
<Card
|
||||||
<Card title="Set up a 1x1 with an Infisical Engineer" iconType="duotone" color="#ca8b04" href="https://calendly.com/maidull/30min">
|
title="Set up a 1x1 with an Infisical Engineer"
|
||||||
Our team is happy to help you get started with Infisical. If you have any questions or want to learn how you can leverage Infisical within your infrastructure, **[set up a 1-on-1 with an Infisical engineer](https://cal.com/maidul/15min)**.
|
iconType="duotone"
|
||||||
|
color="#ca8b04"
|
||||||
|
href="https://calendly.com/maidull/30min"
|
||||||
|
>
|
||||||
|
Our team is happy to help you get started with Infisical. If you have any
|
||||||
|
questions or want to learn how you can leverage Infisical within your
|
||||||
|
infrastructure, **[set up a 1-on-1 with an Infisical
|
||||||
|
engineer](https://cal.com/maidul/15min)**.
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ title: "Quickstart"
|
|||||||
description: "Start managing your developer secrets and configs with Infisical in 10 minutes."
|
description: "Start managing your developer secrets and configs with Infisical in 10 minutes."
|
||||||
---
|
---
|
||||||
|
|
||||||
This example demonstrates how to store and inject environment variables from [Infisical Cloud](https://app.infisical.com) into your application.
|
These examples demonstrate how to store and fetch environment variables from [Infisical Cloud](https://app.infisical.com) into your application.
|
||||||
|
|
||||||
Note that the Infisical CLI is platform-agnostic and can inject environment variables across many tech stacks and frameworks.
|
|
||||||
|
|
||||||
## Set up Infisical Cloud
|
## Set up Infisical Cloud
|
||||||
|
|
||||||
@@ -15,30 +13,100 @@ Note that the Infisical CLI is platform-agnostic and can inject environment vari
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Set up the CLI
|
## Fetch Secrets for Your App
|
||||||
|
|
||||||
1. Follow the instructions to [install the CLI](/cli/overview).
|
<Tabs>
|
||||||
|
<Tab title="CLI">
|
||||||
|
|
||||||
|
The Infisical CLI is platform-agnostic and enables you to inject environment variables into your app across many tech stacks and frameworks.
|
||||||
|
|
||||||
2. Initialize Infisical for your project.
|
### Set up the CLI
|
||||||
|
|
||||||
```bash
|
1. Follow the instructions to [install our platform-agnostic CLI](/cli/overview).
|
||||||
# move to your project
|
|
||||||
cd /path/to/project
|
|
||||||
|
|
||||||
# initialize infisical
|
2. Initialize Infisical for your project.
|
||||||
infisical init
|
|
||||||
```
|
|
||||||
|
|
||||||
## Start your app with environment variables injected
|
```bash
|
||||||
|
# move to your project
|
||||||
|
cd /path/to/project
|
||||||
|
|
||||||
```bash
|
# initialize infisical
|
||||||
# inject environment variables into app
|
infisical init
|
||||||
infisical run -- [your application start command]
|
```
|
||||||
```
|
|
||||||
|
|
||||||
<Info>
|
### Start your app with environment variables injected
|
||||||
Check out our [integrations](/integrations/overview) for injecting environment
|
|
||||||
variables into frameworks and platforms like Docker.
|
|
||||||
</Info>
|
|
||||||
|
|
||||||
Your app should be running with the environment variables injected.
|
```bash
|
||||||
|
# inject environment variables into app
|
||||||
|
infisical run -- [your application start command]
|
||||||
|
```
|
||||||
|
|
||||||
|
Your app should now be running with the environment variables injected.
|
||||||
|
|
||||||
|
Check out our [integrations](/integrations/overview) for injecting environment variables into frameworks and platforms like Docker.
|
||||||
|
|
||||||
|
</Tab>
|
||||||
|
<Tab title="SDK">
|
||||||
|
[Infisical SDKs](/sdks/overview) let your app fetch back secrets using an [Infisical Token](/getting-started/dashboard/token) that is scoped to a project and environment in Infisical. In this example, we demonstrate how to use the [Node SDK](/sdks/languages/node).
|
||||||
|
|
||||||
|
### Obtain an [Infisical Token](/getting-started/dashboard/token)
|
||||||
|
|
||||||
|
Head to your project settings to create a token scoped to the project and environment you wish to fetch secrets from.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Install the SDK
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install infisical-node --save
|
||||||
|
```
|
||||||
|
|
||||||
|
### Initialize the Infisical client
|
||||||
|
|
||||||
|
```js
|
||||||
|
await infisical.connect({
|
||||||
|
token: "your_infisical_token",
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Get a value
|
||||||
|
|
||||||
|
```js
|
||||||
|
const value = infisical.get("SOME_KEY");
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example with Express
|
||||||
|
|
||||||
|
```js
|
||||||
|
const express = require("express");
|
||||||
|
const port = 3000;
|
||||||
|
const infisical = require("infisical-node");
|
||||||
|
|
||||||
|
const main = async () => {
|
||||||
|
await infisical.connect({
|
||||||
|
token: "st.xxx.xxx",
|
||||||
|
});
|
||||||
|
|
||||||
|
// your application logic
|
||||||
|
|
||||||
|
app.get("/", (req, res) => {
|
||||||
|
res.send(`Howdy, ${infisical.get("NAME")}!`);
|
||||||
|
});
|
||||||
|
|
||||||
|
app.listen(port, async () => {
|
||||||
|
console.log(`App listening on port ${port}`);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
<Warning>
|
||||||
|
We do not recommend hardcoding your [Infisical
|
||||||
|
Token](/getting-started/dashboard/token). Setting it as an environment
|
||||||
|
variable would be best.
|
||||||
|
|
||||||
|
</Warning>
|
||||||
|
|
||||||
|
Check out our [SDKs](/sdks/overview) for other language SDKs.
|
||||||
|
|
||||||
|
</Tab>
|
||||||
|
</Tabs>
|
||||||
|
|||||||
@@ -191,15 +191,21 @@
|
|||||||
"self-hosting/configuration/email"
|
"self-hosting/configuration/email"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"group": "Overview",
|
||||||
|
"pages": [
|
||||||
|
"sdks/overview"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"group": "SDKs",
|
"group": "SDKs",
|
||||||
"pages": [
|
"pages": [
|
||||||
"sdks/overview/node",
|
"sdks/languages/node",
|
||||||
"sdks/overview/python",
|
"sdks/languages/python",
|
||||||
"sdks/overview/java",
|
"sdks/languages/java",
|
||||||
"sdks/overview/ruby",
|
"sdks/languages/ruby",
|
||||||
"sdks/overview/go",
|
"sdks/languages/go",
|
||||||
"sdks/overview/rust"
|
"sdks/languages/rust"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
18
docs/sdks/overview.mdx
Normal file
18
docs/sdks/overview.mdx
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
title: "Overview"
|
||||||
|
description: "How to use Infisical SDKs to fetch back secrets for your app"
|
||||||
|
---
|
||||||
|
|
||||||
|
Infisical SDKs provide the easiest way for your app to fetch back secrets using an [Infisical Token](/getting-started/dashboard/token) and has a few benefits:
|
||||||
|
|
||||||
|
- Local development: Replace 10s of environment variables in your `.env` file with 1 environment variable (the [Infisical Token](/getting-started/dashboard/token)).
|
||||||
|
- Production: Fetch secrets back to any cloud regardless of if an integration exists between Infisical and the cloud platform.
|
||||||
|
|
||||||
|
We currently only have the [Node SDK](/sdks/languages/node) available but more language SDKs are coming out soon:
|
||||||
|
|
||||||
|
- [Node](/sdks/languages/node)
|
||||||
|
- [Python](/sdks/languages/python)
|
||||||
|
- [Java](/sdks/languages/java)
|
||||||
|
- [Ruby](/sdks/languages/ruby)
|
||||||
|
- [Go](/sdks/languages/go)
|
||||||
|
- [Rust](/sdks/languages/rust)
|
||||||
Reference in New Issue
Block a user