Config

Members

(static) globalConfig :Config

Source:
Type:
  • Config

(inner, constant) excludeFromGeneratedIndex :Array.<string>

Description:
  • Exported functions that are excluded from index generation.
Source:
Exported functions that are excluded from index generation.
Type:
  • Array.<string>

Methods

(static) initializeService(config)

Description:
  • Initializes the service with the given configuration. This function must be called before using any other functions in this library. Automatically initializes award definitions with 24-hour cache in the background.
Source:
Examples
Web Application
initializeService({
  sanityConfig: {
    token: 'your-sanity-api-token',
    projectId: 'your-sanity-project-id',
    dataset: 'your-dataset-name',
    version: '2021-06-07',
    debug: true,
    useCachedAPI: false,
  },
  railcontentConfig: {
    token: 'your-user-api-token',
    userId: 'current-user-id',
    baseUrl: 'https://web-staging-one.musora.com',
    authToken: 'your-auth-token',
  },
  sessionConfig: {
    token: 'your-user-api-token',
    userId: 'current-user-id',
    authToken: 'your-auth-token',
  },
  baseUrl: 'https://web-staging-one.musora.com',
  localStorage: localStorage,
  isMA: false,
  permissionsVersion: 'v1', // Optional: 'v1' (default) or 'v2'
  appEnv: 'local'
});
React Native Application
import AsyncStorage from '@react-native-async-storage/async-storage'

initializeService({
  sanityConfig: { ... },
  railcontentConfig: { ... },
  sessionConfig: { ... },
  baseUrl: 'https://web-staging-one.musora.com',
  localStorage: AsyncStorage,
  isMA: true,
  localTimezoneString: '',
  permissionsVersion: 'v2',
  appEnv: 'local'
});
Parameters:
Name Type Description
config Config Configuration object containing API settings.