mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Add preliminary platform, sdks, and cli quickstarts
This commit is contained in:
118
docs/getting-started/quickstarts/cli.mdx
Normal file
118
docs/getting-started/quickstarts/cli.mdx
Normal file
@@ -0,0 +1,118 @@
|
||||
---
|
||||
title: "CLI"
|
||||
---
|
||||
|
||||
The CLI is commonly used in local development instead of `.env` files to inject secrets from the Infisical platform into any framework including [Next.js](/integrations/frameworks/nextjs), [Express](/integrations/frameworks/express), [Flask](/integrations/frameworks/flask), [Ruby on Rails](/integrations/frameworks/rails), [Laravel](/integrations/frameworks/laravel) and [more](/integrations/overview) as environment variables.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- Have a project with secrets ready in [Infisical Cloud](https://app.infisical.com)
|
||||
|
||||
## Installation
|
||||
|
||||
Follow the instructions for your operating system to install the Infisical CLI.
|
||||
|
||||
<Tabs>
|
||||
<Tab title="MacOS">
|
||||
Use [brew](https://brew.sh/) package manager
|
||||
|
||||
```console
|
||||
$ brew install infisical/get-cli/infisical
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="Windows">
|
||||
Use [Scoop](https://scoop.sh/) package manager
|
||||
|
||||
```console
|
||||
$ scoop bucket add org https://github.com/Infisical/scoop-infisical.git
|
||||
```
|
||||
|
||||
```console
|
||||
$ scoop install infisical
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="Alpine">
|
||||
Install prerequisite
|
||||
```console
|
||||
$ apk add --no-cache bash sudo
|
||||
```
|
||||
|
||||
Add Infisical repository
|
||||
```console
|
||||
$ curl -1sLf \
|
||||
'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' \
|
||||
| bash
|
||||
```
|
||||
|
||||
Then install CLI
|
||||
```console
|
||||
$ apk update && sudo apk add infisical
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab title="RedHat/CentOs/Amazon">
|
||||
Add Infisical repository
|
||||
```console
|
||||
$ curl -1sLf \
|
||||
'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.rpm.sh' \
|
||||
| sudo -E bash
|
||||
```
|
||||
|
||||
Then install CLI
|
||||
```console
|
||||
$ sudo yum install infisical
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab title="Debian/Ubuntu">
|
||||
Add Infisical repository
|
||||
|
||||
```console
|
||||
$ curl -1sLf \
|
||||
'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' \
|
||||
| sudo -E bash
|
||||
```
|
||||
|
||||
Then install CLI
|
||||
```console
|
||||
$ sudo apt-get update && sudo apt-get install -y infisical
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab title="Arch Linux">
|
||||
Use the `yay` package manager to install from the [Arch User Repository](https://aur.archlinux.org/packages/infisical-bin)
|
||||
|
||||
```console
|
||||
$ yay -S infisical-bin
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Login
|
||||
|
||||
Authenticate the CLI with the Infisical platform using your email and password.
|
||||
|
||||
```console
|
||||
$ infisical login
|
||||
```
|
||||
|
||||
## Initialization
|
||||
|
||||
Navigate to the root of your project directory and run the `init` command. This step connects your local project to the project on the Infisical platform and creates a `infisical.json` file containing a reference to that latter project.
|
||||
|
||||
```console
|
||||
$ infisical init
|
||||
```
|
||||
|
||||
## Start your app with environment variables injected
|
||||
|
||||
```console
|
||||
$ infisical run -- [your application start command]
|
||||
```
|
||||
|
||||
Your app should now be running with the secrets from Infisical injected as environment variables.
|
||||
|
||||
Resources:
|
||||
|
||||
- [List of confirmed frameworks](/integrations/overview)
|
||||
4
docs/getting-started/quickstarts/docker.mdx
Normal file
4
docs/getting-started/quickstarts/docker.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Docker"
|
||||
description: "Inject secrets into your Docker containers"
|
||||
---
|
||||
4
docs/getting-started/quickstarts/k8s.mdx
Normal file
4
docs/getting-started/quickstarts/k8s.mdx
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Kubernetes"
|
||||
description: "Fetch and save secrets as native Kubernetes secrets"
|
||||
---
|
||||
41
docs/getting-started/quickstarts/overview.mdx
Normal file
41
docs/getting-started/quickstarts/overview.mdx
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
title: "Overview"
|
||||
---
|
||||
|
||||
### Learn about Infisical
|
||||
|
||||
<Card
|
||||
href="/getting-started/quickstarts/platform"
|
||||
title="Platform"
|
||||
icon="laptop"
|
||||
color="#dc2626"
|
||||
>
|
||||
Store secrets like API keys, database credentials, environment variables with Infisical
|
||||
</Card>
|
||||
|
||||
### Integrate with Infisical
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card
|
||||
title="SDKs"
|
||||
href="/getting-started/quickstarts/sdks"
|
||||
icon="boxes-stacked"
|
||||
color="#3c8639"
|
||||
>
|
||||
Fetch secrets for any programming language on demand
|
||||
</Card>
|
||||
<Card href="/getting-started/quickstarts/cli" title="Command Line Interface" icon="square-terminal" color="#3775a9">
|
||||
Inject secrets into any application process/environment
|
||||
</Card>
|
||||
<Card href="/getting-started/quickstarts/docker" title="Docker" icon="docker" color="#0078d3">
|
||||
Inject secrets into Docker containers
|
||||
</Card>
|
||||
<Card
|
||||
href="/getting-started/quickstarts/k8s"
|
||||
title="Kubernetes"
|
||||
icon="server"
|
||||
color="#3775a9"
|
||||
>
|
||||
Fetch and save secrets as native Kubernetes secrets
|
||||
</Card>
|
||||
</CardGroup>
|
||||
61
docs/getting-started/quickstarts/platform.mdx
Normal file
61
docs/getting-started/quickstarts/platform.mdx
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: "Platform"
|
||||
---
|
||||
|
||||
Infisical is an [open-source](https://opensource.com/resources/what-open-source), [end-to-end encrypted](https://en.wikipedia.org/wiki/End-to-end_encryption) secret management platform that enables teams to easily store, manage, and sync secrets like API keys, database credentials, and environment variables across their apps and infrastructure.
|
||||
|
||||
This quickstart provides an overview of the core and useful functionalities offered by the platform.
|
||||
|
||||
## Usage
|
||||
|
||||
Infisical can be used on [Infisical Cloud](https://app.infisical.com/login) (our hosted/managed solution) or [self-hosted on your own infrastructure](/self-hosting/overview).
|
||||
|
||||
Inside Infisical, you'll find that every secret belongs to a project that in turn belongs to an organization.
|
||||
|
||||
## Projects
|
||||
|
||||
Project houses secrets for applications.
|
||||
|
||||
### Secrets Overview
|
||||
|
||||
The secrets overview provides a bird's-eye view of all the secrets in a project and is particularly useful for identifying missing secrets across environments.
|
||||
|
||||

|
||||
|
||||
### Secrets Dashboard
|
||||
|
||||
The secrets dashboard lets you manage secrets for a specific environment in a project.
|
||||
Here, developers can [override secrets](/getting-started/dashboard/project#personal-overrides), [version secrets](/getting-started/dashboard/secret-versioning), [rollback projects to any point in time](/getting-started/dashboard/pit-recovery), and much more.
|
||||
|
||||

|
||||
|
||||
### Integrations
|
||||
|
||||
The integrations page provides native integrations to sync secrets from a project environment to a [host of ever-expanding integrations](/integrations/overview).
|
||||
|
||||
<Tip>
|
||||
Depending on your infrastructure setup and compliance requirements, you may or may not prefer to use these native integrations since they break end-to-end encryption (E2EE).
|
||||
|
||||
You will learn about various ways to integrate with Infisical and maintain E2EE in subsequent quickstart sections.
|
||||
</Tip>
|
||||
|
||||

|
||||
|
||||
### Access Control
|
||||
|
||||
The members page lets you add/remove members for a project and provision them access to environments (access levels include `No Access`, `Read Only`, and `Read and Write`).
|
||||
|
||||

|
||||
|
||||
## Organizations
|
||||
|
||||
Organizations house projects and members.
|
||||
|
||||
### Organization Settings
|
||||
|
||||
At the organization-level, you can add/remove members and manage their access to projects.
|
||||
|
||||

|
||||

|
||||
|
||||
That's it for the platform quickstart! — We encourage you to continue exploring the documentation to gain a deeper understanding of the extensive features and functionalities that Infisical has to offer.
|
||||
143
docs/getting-started/quickstarts/sdks.mdx
Normal file
143
docs/getting-started/quickstarts/sdks.mdx
Normal file
@@ -0,0 +1,143 @@
|
||||
---
|
||||
title: "SDKs"
|
||||
---
|
||||
|
||||
From local development to production, Infisical's language-specific SDKs provide the easiest way for your app to fetch back secrets on demand.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- Have a project with secrets ready in [Infisical Cloud](https://app.infisical.com)
|
||||
- Create an [Infisical Token](/getting-started/dashboard/token) scoped to an environment in your project.
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Node">
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Run `npm` to add [infisical-node](https://github.com/Infisical/infisical-node) to your project.
|
||||
|
||||
```console
|
||||
$ npm install infisical-node --save
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Import the SDK and create a client instance with your [Infisical Token](/getting-started/dashboard/token).
|
||||
|
||||
<Tabs>
|
||||
<Tab title="ES6">
|
||||
```js
|
||||
import InfisicalClient from "infisical-node";
|
||||
|
||||
const client = new InfisicalClient({
|
||||
token: "your_infisical_token"
|
||||
});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab title="ES5">
|
||||
```js
|
||||
const InfisicalClient = require("infisical-node");
|
||||
|
||||
const client = new InfisicalClient({
|
||||
token: "your_infisical_token"
|
||||
});
|
||||
````
|
||||
</Tab>
|
||||
</Tabs>
|
||||
## Get a Secret
|
||||
|
||||
```js
|
||||
const secret = await client.getSecret("API_KEY");
|
||||
const value = secret.secretValue; // get its value
|
||||
```
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```js
|
||||
import express from "express";
|
||||
import InfisicalClient from "infisical-node";
|
||||
const app = express();
|
||||
const PORT = 3000;
|
||||
|
||||
const client = new InfisicalClient({
|
||||
token: "YOUR_INFISICAL_TOKEN"
|
||||
});
|
||||
|
||||
app.get("/", async (req, res) => {
|
||||
// access value
|
||||
const name = await client.getSecret("NAME");
|
||||
res.send(`Hello! My name is: ${name.secretValue}`);
|
||||
});
|
||||
|
||||
app.listen(PORT, async () => {
|
||||
console.log(`App listening on port ${port}`);
|
||||
});
|
||||
```
|
||||
|
||||
This example demonstrates how to use the Infisical Node SDK with an Express application. The application retrieves a secret named "NAME" and responds to requests with a greeting that includes the secret value.
|
||||
|
||||
For a comprehensive overview, refer to the complete [documentation for the Node SDK](/sdks/languages/node).
|
||||
</Tab>
|
||||
<Tab title="Python">
|
||||
|
||||
## Installation
|
||||
|
||||
Run `pip` to add [infisical-python](https://github.com/Astropilot/infisical-python) to your project
|
||||
|
||||
```console
|
||||
$ pip install infisical
|
||||
```
|
||||
|
||||
Note: You need Python 3.7+.
|
||||
|
||||
## Configuration
|
||||
|
||||
Import the SDK and create a client instance with your [Infisical Token](/getting-started/dashboard/token).
|
||||
|
||||
```py
|
||||
from infisical import InfisicalClient
|
||||
|
||||
client = InfisicalClient(token="your_infisical_token")
|
||||
```
|
||||
|
||||
## Get a Secret
|
||||
|
||||
```py
|
||||
secret = client.get_secret("API_KEY")
|
||||
value = secret.secret_value # get its value
|
||||
```
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```py
|
||||
from flask import Flask
|
||||
from infisical import InfisicalClient
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
client = InfisicalClient(token="your_infisical_token")
|
||||
|
||||
@app.route("/")
|
||||
def hello_world():
|
||||
# access value
|
||||
name = client.get_secret("NAME")
|
||||
return f"Hello! My name is: {name.secret_value}"
|
||||
```
|
||||
|
||||
This example demonstrates how to use the Infisical Python SDK with a Flask application. The application retrieves a secret named "NAME" and responds to requests with a greeting that includes the secret value.
|
||||
|
||||
For a comprehensive overview, please refer to the complete [documentation for the Python SDK](/sdks/languages/python).
|
||||
</Tab>
|
||||
<Tab title="Other">
|
||||
We're currently working on SDKs for other languages. Follow the GitHub issue for your needed language below:
|
||||
- [Java](https://github.com/Infisical/infisical/issues/434)
|
||||
- [Ruby](https://github.com/Infisical/infisical/issues/435)
|
||||
- [Go](https://github.com/Infisical/infisical/issues/436)
|
||||
- [Rust](https://github.com/Infisical/infisical/issues/437)
|
||||
- [PHP](https://github.com/Infisical/infisical/issues/531)
|
||||
|
||||
Missing a language? Throw in a [request](https://github.com/Infisical/infisical/issues).
|
||||
</Tab>
|
||||
</Tabs>
|
||||
Reference in New Issue
Block a user