Getting started in 5 minutes

Getting setup with prefab cloud should take you 5 minutes.

Account Creation

First you will need to create an account in the Prefab UI. Accounts are free to create, so you don't need to think too hard. Most likely you'll want to end up with:

  • Testing
  • MyCorp-Prod
  • MyCorp-Staging
  • MyCorp-Dev

For now you can just create 'Testing'

You do need to put in a credit card, but you won't be charged for anything under $2/month (about 400k rate limit calls). See Pricing for details but tl;dr this is not going to bite you.

API Key

You'll now have an API key. It will look like ACCT_ID|APIKEY

Prefab cloud libraries will look for the ENV var PREFAB_API_KEY or you can specify it directly.

# gem install prefab-cloud-ruby
client = Prefab::Client.new # reads PREFAB_API_KEY env var
# or
client = Prefab::Client.new(api_key: "ACCT_ID|APIKEY")
<dependency>
    <groupId>cloud.prefab</groupId>
    <artifactId>prefab-cloud-java</artifactId>
    <version>0.0.5</version>
</dependency>

final PrefabCloudClient prefabCloudClient = new PrefabCloudClient(new PrefabCloudClient.Builder());
// or
final PrefabCloudClient prefabCloudClient = new PrefabCloudClient(new PrefabCloudClient.Builder()
    .setApikey("ACCT_ID|APIKEY"));
//npm install prefab-cloud
var client = new PrefabCloudClient();  // Defaults to ENV[PREFAB_API_KEY]

Try it out!

Let's try a feature flag

client = Prefab::Client.new
@feature_flags = client.feature_flag_client
flag_name = "MyFeature"
puts "#{flag_name} is #{@feature_flags.feature_is_on? flag_name}"
final PrefabCloudClient prefabCloudClient = new PrefabCloudClient(new PrefabCloudClient.Builder());
final FeatureFlagClient featureFlagClient = prefabCloudClient.featureFlagClient();

String flagName = "MyFeature";
print(String.format("%s is %b", flagName, featureFlagClient.featureIsOn(flagName));
var client = new PrefabCloudClient();
client.getFeatureFlag("MyFeature").isOn();
Now create a flag named MyFeature in the UI. Drag the slider to 100% and run the program again and run your program again.

Next up