“Hello World” Experience Provider
Note: You can see the code and execute it on our RIN REPL. Try to edit the RIN so that the narrative runs for 30 seconds instead of the 20.
Let’s go through the structure of “HelloWorldExperience.js”. The entire script is encapsulated in the body of an anonymous function that creates and registers the provider under the name “HelloWorldExperienceProvider”:
The script sets up the HelloWorldExperienceProvider object so that it inherits the methods expected by RIN:
This is all that is required to register an Experience Provider factory function with RIN. RIN calls this factory function each time it needs to play a narrative that contains an Experience with the named provider. The function is called with two parameters: orchestrator and esData. The orchestrator parameter is a proxy to the RIN core orchestrator and supports a number of methods that Experience Providers typically need to call while rendering the Experience. These methods are documented in here. The esData parameter is the actual Experience data as defined in the RIN data specification.
The full code of the HelloWorldExperienceProvider: