Giter Site home page Giter Site logo

experiment-go-server's Introduction

experiment-go-server

Amplitude Experiment SDK for Go.

Documentation

Visit our developer docs site for the full SDK documentation.

Command-line Interface (xpmt)

The xpmt command-line interface tool allows you to make Experiment SDK calls from the command line. This tool is meant to be used for debugging and testing, not for use in production environments.

Build

Makefile currently only builds for macos (amd64 & x64), add a line to the Makefile to support your OS and Architecture.

make xpmt

Run

!!!warning Setting the deployment key All examples below assume the EXPERIMENT_KEY environment variable has been set. Alternatively, use the -k flag to set the key in the command.

Subcommands

  • fetch: fetch variants for a user from the server
  • rules: fetch flag configs (rules) from experiment
  • evaluate: fetch flag configs from experiment and evaluate the user locally

Fetch

Fetch variants via remote evaluation for the given input user.

Usage of fetch:
  -d string
        Device id to fetch variants for.
  -debug
        Log additional debug output to std out.
  -i string
        User id to fetch variants for.
  -k string
        Api key for authorization, or use EXPERIMENT_KEY env var.
  -staging
        Use skylab staging environment.
  -u string
        The full user object to fetch variants for.
  -url string
        The server url to use to fetch variants from.

Examples

Fetch variants for a user given the user ID

./xpmt fetch -i [email protected]

Fetch variants for a user given the device ID

./xpmt fetch -d Xg0nG1v3iToYA

Fetch variants for a user given an experiment user JSON object

./xpmt fetch -u '{"user_id":"[email protected]","user_properties":{"premium":true}}'

Note: must use single quotes around JSON object string

Evaluate

Fetch flag configurations and locally evaluate the user.

Usage of evaluate:
  -d string
        Device id to fetch variants for.
  -debug
        Log additional debug output to std out.
  -i string
        User id to fetch variants for.
  -k string
        Server api key for authorization, or use EXPERIMENT_KEY env var.
  -staging
        Use skylab staging environment.
  -u string
        The full user object to fetch variants for.
  -url string
        The server url to use poll for flag configs from.

Examples

Fetch variants for a user given the user ID

./xpmt evaluate -i [email protected]

Fetch variants for a user given the device ID

./xpmt evaluate -d Xg0nG1v3iToYA

Fetch variants for a user given an experiment user JSON object

./xpmt evaluate -u '{"user_id":"[email protected]","user_properties":{"premium":true}}'

Note: must use single quotes around JSON object string

experiment-go-server's People

Contributors

bgiori avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.