You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the Optimizely `Full Stack documentation`_ to learn how to
33
+
You can initialize the Optimizely instance in three ways: with a datafile, by providing an `sdk_key`, or by providing a `ConfigManager`_. Each method is described below.
34
+
35
+
1. Initialize Optimizely with a datafile. This datafile will be used as
36
+
ProjectConfig throughout the life of Optimizely instance.
37
+
::
38
+
39
+
optimizely.Optimizely(
40
+
datafile
41
+
)
42
+
43
+
2. Initialize Optimizely by providing an 'sdk_key'. This will initialize
44
+
a PollingConfigManager that makes an HTTP GET request to the URL (formed
45
+
using your provided `sdk key` and the default datafile CDN URL
46
+
template) to asynchronously download the project datafile at regular
47
+
intervals and update ProjectConfig when a new datafile is recieved. A
48
+
hard-coded datafile can also be provided along with the `sdk_key` that
49
+
will be used initially before any update.
50
+
::
51
+
52
+
optimizely.Optimizely(
53
+
sdk_key='put_your_sdk_key_here'
54
+
)
55
+
56
+
3. Initialize Optimizely by providing a ConfigManager that implements `BaseConfigManager`_. You may use our `PollingConfigManager` as needed.
57
+
::
58
+
59
+
optimizely.Optimizely(
60
+
config_manager=custom_config_manager
61
+
)
62
+
63
+
PollingConfigManager
64
+
''''''''''''''''''''
65
+
66
+
The `PollingConfigManager` asynchronously polls for datafiles from a
67
+
specified URL at regular intervals by making HTTP requests.
0 commit comments