Integration Guide - Tyk API Gateway

Introduction

Tyk is an open source API Gateway. Whether you are publishing an open API or need to manage your internal ones, Tyk can be used to control who accesses your API, when they access it, and how they access it

Important GitHub repos:

The Tyk Analytics Pump can be configured to move analytics data to any supported backend, including Moesif.

Setup

  1. Follow Tyk’s setup instructions to get a Tyk Gateway instance running. You will also need to set up a Tyk Pump instance, if you haven’t already. Here is the guide for Ubuntu

  2. Create a pump.conf to configure the Tyk Analytics Pump and add Moesif as a backend:

{
	"analytics_storage_type": "redis",
	"analytics_storage_config": {
		"type": "redis",
		"host": "localhost",
		"port": 6379,
		"hosts": null,
		"username": "",
		"password": "",
		"database": 0,
		"optimisation_max_idle": 100,
		"optimisation_max_active": 0,
		"enable_cluster": false,
		"redis_use_ssl": false,
    	"redis_ssl_insecure_skip_verify": false
	},
	"purge_delay": 10,
	"health_check_endpoint_name": "hello",
  	"health_check_endpoint_port": 8080,
	"pumps": {
		"dummy": {
			"name": "dummy",
			"meta": {}
		},
		"mongo": {
			"name": "mongo",
			"meta": {
				"collection_name": "tyk_analytics",
				"mongo_url": "mongodb://username:password@{hostname:port},{hostname:port}/{db_name}"
			}
		},
		"moesif": {
			"name": "moesif",
			"meta": {
				"application_id": "Your Moesif Application Id"
			}
		},
	},
	"uptime_pump_config": {
		"collection_name": "tyk_uptime_analytics",
		"mongo_url": "mongodb://username:password@{hostname:port},{hostname:port}/{db_name}"
	},
	"dont_purge_uptime_data": false
}

The only Moesif specific setting is application_id. You can find your Application Id from Moesif Dashboard -> Top Right Menu -> Extensions Setup -> Tyk API Gateway

Multiple Tyk api_id’s will be organized under the same Moesif application id.

Updated: