Companion container to https://github.com/TransmitSecurity/ciam-expressjs-vanilla-samples.
5.8K
This repository contains sample web apps corresponding to the guides in the Transmit Security developer portal.
Each directory contains a STANDALONE sample app that can be configured with your tenant data. All
samples are independant from the other samples, except from minimal shared code under the shared
directory. All samples are configured to use your Transmit tenant via a .env file that you need to
create at the root of the project as seen below.
You can either launch sample apps directly from the browser using GitHub Codespaces, or clone and run from your local machine. See below instructions for both flavors.
You can connect the samples to your own Transmit Security tenant and launch them from a Codespace environment
(0:10) Launch code spaces via the <> Code button. If you do not see this button, click
this link to get back to the
repo root.
(0:22) Create a .env file at the root of the project, and copy the content of sample.env into
it. Adding a file is done by clicking the +file icon at the top if the left hand file explorer, as
the video shows.
(0:29) Copy the URL of the codespace - and paste it into the new .env file as the value for
TS_REDIRECT_URI. Add /complete at the end (make sure you only have a single slash here
/complete), and add -8080.app before the github.dev suffix. For example:
https://ts-ron-legendary-waddle-rx7774944x4cwwrv.github.dev will be edited to
https://ts-ron-legendary-waddle-rx7774944x4cwwrv-8080.app.github.dev/complete.
Copy the above value to be used in the next steps
/complete suffix), and the domain as the
RPID.(1:26) Now, go back to the application page update your .env file:
VITE_TS_CLIENT_ID should contain your Client IDTS_CLIENT_SECRET should contain your Client secretTS_APP_ID should contain you Application IDTS_REDIRECT_URI should already be configures as seen above(1:52) Build the sample from the root directory yarn
(1:59) Launch the sample using the script ./launch.sh as seen below, or use
SAMPLE=<directory-name> yarn start as seen on the video where <directory-name> is the
directory of the sample you want to run. The sample will launch on port 8080 and a button will
appear to launch the UI on a separate tab. If a button does not appear, go to the "Ports" tab and
expose 8080 explicitly, as seen in the video
Don't forget to stop your code space when you are done! For more information on code spaces PLS visit https://code.visualstudio.com/docs/remote/codespaces
To run the project locally, follow the same steps described in the Codespace set up, but for your local environment.
http://localhost:8080/complete, similar change for the webauthn
origin and RPIDnpm, you might need to use the --force option when installing the
modules:npm install --force
SAMPLE=<directory-name> npm run start
The content of this repository is also packaged as a container on Dockerhub, see transmitsecurity/js-vanilla-samples.
To launch this container, you can either use a direct shell command where each envionment variable
in the .env file is translated into a -e VAR=value section in the below:
docker run --platform linux/amd64 -e SAMPLE=<directory-name> -e ... -p 8080:8080 transmitsecurity/js-vanilla-samples:latest
Alternatively, you can use the docker_launch.sh utility, which is identical to launch.sh except
it launches the container, and appends the values inside the .env automatically.
Some samples might require you to use web browsers on mobile devices. This is the case of the WebAuthn cross device sample. To debug Chrome or Safari browsers running on a mobile device, you can refer to the following documentations:
By default, the samples work with the US production cluster. However if you are working with a
tenant that resides on a different cluster, e.g. EU or a staging cluster, consult your Transmit
contact person and configure the following environment variable in your .env file:
VITE_TS_API_BASE
Animated robot courtesy of https://opengameart.org/content/pixel-robotContent type
Image
Digest
sha256:78c4e670f…
Size
270.3 MB
Last updated
about 2 years ago
docker pull transmitsecurity/js-vanilla-samples