-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove duplication in documentation (#148)
Single page about environment variables, logging, error handling, and forms. We previously had separate pages under Shipping/Orders/Fulfillment Providers that had the exact same content. The information applies to all apps and should be available at a higher level.
- Loading branch information
1 parent
7a0a795
commit 6e591bd
Showing
20 changed files
with
117 additions
and
196 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Forms | ||
|
||
A part of the ShipEngine Connect platform is allowing integrations to define their own forms used for things like registering or connecting a new account, and updating settings in the case of shipping integrations. These forms are defined using a library call `rect-jsonschema-form` and are comprised of two parts, a `JsonSchema` and a `UiSchema`. | ||
A part of the ShipEngine Connect platform is allowing integrations to define | ||
their own forms used for things like registering or connecting a new account. | ||
These forms are defined using the [react-jsonschema-form](https://rjsf-team.github.io/react-jsonschema-form/docs/) syntax, and are comprised of two parts, a `JsonSchema` and a `UiSchema`. |
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 |
---|---|---|
|
@@ -81,7 +81,7 @@ The next step will be to publish your application using the `connect publish` co | |
- Contact a member of the [ShipEngine Connect Team](mailto:[email protected]?subject=OAuth%20Installation) in order to establish the platform installation | ||
- Provide a ClientId & ClientSecret used for initiating the oauth workflow | ||
- Once the installation has been created you will recieve back a callback url | ||
- Once the installation has been created you will receive back a callback url | ||
|
||
## Test | ||
:::success PRO TIP | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
--- | ||
title: Managing App Environment Variables | ||
title: Managing Configuration | ||
--- | ||
|
||
# Managing Environment Variables | ||
# Managing Configuration | ||
|
||
The `shipengine-connect env` command allows you to set environment variables that | ||
will be available to your app once it is published to ShipEngine Connect. This | ||
|
@@ -19,28 +19,57 @@ When you run the `shipengine-connect env` command, you will include one of its | |
subcommands listed below to indicate which environment variable action you would | ||
like to perform. | ||
|
||
## Set Environment Variables | ||
## Commands | ||
|
||
### Set Environment Variables | ||
This subcommand sets one or more environment variables. | ||
|
||
`shipengine-connect env:set NAME=value NAME_2=value2 ... NAME_N=valueN [OPTIONS]` | ||
|
||
Example: | ||
|
||
```bash | ||
shipengine-connect env:set NAME=value NAME_2=value2 ... NAME_N=valueN [OPTIONS] | ||
shipengine-connect env:set API_URL=https://www.sandbox.example.com/api API_KEY=3435dfafa32424 | ||
``` | ||
|
||
## Get Environment Variables | ||
This subcommand lists the current value for one or more environment variables. | ||
```bash | ||
shipengine-connect env:get NAME NAME_2 ... NAME_N [OPTIONS] | ||
Output: | ||
|
||
``` | ||
API_URL=https://www.sandbox.example.com/api has been set | ||
API_KEY=3435dfafa32424 has been set | ||
``` | ||
|
||
## List Environment Variables | ||
### List Environment Variables | ||
This subcommand lists the values of all environment variables. | ||
|
||
`shipengine-connect env:list [OPTIONS]` | ||
|
||
Example: | ||
|
||
```bash | ||
shipengine-connect env:list | ||
``` | ||
|
||
### Get Environment Variables | ||
This subcommand lists the current value for one or more environment variables. | ||
|
||
`shipengine-connect env:get NAME NAME_2 ... NAME_N [OPTIONS]` | ||
|
||
Example: | ||
|
||
```bash | ||
shipengine-connect env:list [OPTIONS] | ||
shipengine-connect env:get API_URL | ||
``` | ||
|
||
## Unset Environment Variables | ||
### Unset Environment Variables | ||
This subcommand unsets one or more environment variables. | ||
|
||
`shipengine-connect env:unset NAME NAME_2 ... NAME_N [OPTIONS]` | ||
|
||
Example: | ||
|
||
```bash | ||
shipengine-connect env:unset NAME NAME_2 ... NAME_N [OPTIONS] | ||
shipengine-connect env:unset API_URL | ||
``` | ||
|
||
## Options | ||
|
@@ -54,3 +83,22 @@ This option formats the output of the `shipengine-connect list` command. Set | |
this option to `table` to list the environment variables in a table format or | ||
`dotenv` to list the environment variables in the | ||
[dotenv](https://www.npmjs.com/package/dotenv) format. | ||
|
||
## Recommendations | ||
|
||
### Single File | ||
We typically recommend having a single file in your project where you access your enviornment variables. This could be a `constants.ts` file, and we recommend having preset values that default to staging variables. | ||
|
||
**Example** | ||
|
||
```TypeScript constants.ts | ||
export const API_URL = process.env.API_URL ?? 'https://www.sandbox.example.com/api'; | ||
``` | ||
```TypeScript consumer.ts | ||
import { API_URL } from './constants' | ||
|
||
``` | ||
|
||
### Moving to Production | ||
We recommend when reaching out to the [ShipEngine Connect Team](mailto:[email protected]) to have your application moved into our production systems, that you also notify them of any environment variables that will need to be set, and what their values should be in both testing and production environments. | ||
|
File renamed without changes.
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.