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
Copy file name to clipboardExpand all lines: docs/index.rst
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
.. _reddit_decider:
2
2
3
3
``reddit_decider``
4
-
===============================
4
+
==================
5
5
6
6
.. automodule:: reddit_decider
7
7
@@ -103,6 +103,24 @@ Make sure :code:`EdgeContext` is accessible on :code:`request` object like so:
103
103
104
104
request.edge_context
105
105
106
+
If you **don't have access** to :code:`edge_context` in your service/request, you can access the SDK’s internal decider instance for a lower level API,
107
+
allowing you to pass in targeting context fields as a :code:`dict` param,
108
+
e.g. "user_is_employee", "country_code", or other targeting fields (instead of them being auto-derived from :code:`edge_context`).
109
+
110
+
See full API in `readme <https://github.snooguts.net/reddit/decider/tree/master/decider-py#class-decider>`_ (reddit internal).
111
+
112
+
The internal decider instance can be accessed from the SDK's top-level decider instance via:
[Optional] Define request field extractor function (`example <https://github.snooguts.net/reddit/reddit-service-graphql/blob/master/graphql-py/graphql_api/models/experiment.py#L67-L92>`_)
108
126
@@ -132,7 +150,7 @@ Make sure :code:`EdgeContext` is accessible on :code:`request` object like so:
132
150
133
151
Basic Usage
134
152
-----------
135
-
Use the attached :py:class:`~reddit_decider.Decider` object in request to call
153
+
Use the attached :py:class:`~reddit_decider.Decider` instance in request to call
136
154
:code:`decider.get_variant()` (automatically sends an expose event)::
137
155
138
156
def my_method(request):
@@ -146,12 +164,13 @@ or optionally, if manual exposure is necessary, use::
0 commit comments