API Key
When you purchase Rails Designer, you get an unique, personal API key that gives you access to the private Rails Designer gem. This key is used to authenticate you when fetching the gem from get.railsdesigner.com
.
The API key is tied to the email used when purchasing Rails Designer and must not be shared publicly or transferred. It may be shared within your team for development purposes on your Rails application.
There are multiple ways to add the API key to your app:
- export as an environment variable;
- add to the Bundler configuration;
- as basic authentication scheme.
Environment variable
When you set an environment variable, it is stored temporarily in the shell’s environment, making the API key available to your Rails app and other processes started from that shell session.
The environment variable does not persist between sessions; it is only available for the duration of the current shell session and would need to be re-exported in new sessions unless it’s added to a shell configuration file (like .bashrc
or .bash_profile
for Bash) for automatic loading on new sessions. You can also use a gem, like dotenv.
export BUNDLE_GET__RAILSDESIGNER__COM=<api_key>
Add to Bundler configuration
As the second option for integrating your Rails Designer API key, you can use the command bundle config set --global get.railsdesigner.com <api_key>
.
This method allows you to specify the API key either globally for all Ruby projects on your system or on a per-project basis, depending on whether you include the optional --global
flag.
bundle config set --global get.railsdesigner.com <api_key>
Basic authentication
With the basic authentication method, embedding the API key directly in the URL provides immediate access for the session without the need for additional headers or tokens.
This authentication method, while convenient, requires careful handling to prevent security risks, as embedding the API key in URLs can lead to unintentional exposure through server logs, or if accidentally committed to a Git repository and pushed to GitHub, thereby making the key publicly accessible.
source "https://<api_key>@get.railsdesigner.com/private" do
# …
end