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: README.md
+97-1Lines changed: 97 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ This is a set of components that is to be used to build a Quintype Node App. Thi
37
37
* [Marquee for Breaking News](#marquee-for-breaking-news)
38
38
* [ReactTable for table story elements](#reacttable-for-table-story-elements)
39
39
* [UpdateOnInterval](#UpdateOnInterval)
40
+
* [AccessType](#accesstype)
40
41
41
42
### BreakingNews
42
43
This component will automatically fetch breaking news every 30 seconds, and render the provided view.
@@ -609,4 +610,99 @@ The story table element renders a very basic table story element. It can be enha
609
610
({data}) =><Component data={data}></Component>
610
611
}
611
612
</UpdateOnInterval>
612
-
```
613
+
```
614
+
615
+
### AccessType
616
+
617
+
`AccessType` is a generic connected render prop which exposes methods to handle access to stories / assets and initialize accesstype js
618
+
619
+
Name | arguments | Description
620
+
--- | --- | ---
621
+
`initAccessType`| -NA- | Initializes accesstype, checks for existance of accesstype before requesting for AT js
622
+
`initRazorPayPayment`| `selectedPlan`(object) | Executes accesstype js method to bring forth RP payment gateway
623
+
`checkAccess`| `assetId`(string) | Checks if the user has access to the story/asset id passed
624
+
`getSubscriptionForUser`| -NA- | Gets the subscriptions of the current logged in user
625
+
`accessUpdated`| `accessObject`(object) | Sets the current story access to redux store
626
+
`accessIsLoading`| `loading`(boolean) | A boolean which holds true between the request for access of a story and its response
627
+
628
+
629
+
##### Props
630
+
631
+
Name | type | isRequired
632
+
--- | --- | ---
633
+
`children`| `func` | yes
634
+
`email`| `string` | no
635
+
`phone`| `number` | no
636
+
`isStaging`| `boolean` | no
637
+
`enableAccesstype`| `boolean` | yes
638
+
`accessTypeKey`| `string` | yes
639
+
640
+
641
+
###### Notes :
642
+
643
+
* This component uses AccessType Js internally
644
+
* It uses the Access API from subtype for metering, the API works on firebase which uses `thinmint` cookie (set by qlitics) of the user to verify and keep track of visits
645
+
* This component only supports Razorpay payment options for now
646
+
* It communicates to sketches where routes are in pattern `/api/access/v1/*`
647
+
* Metered story has a pingback which is achieved by the use of `navigator.sendBeacon` if available or falls back to fetch, this is needed to update the count of the visited stories for a user
648
+
* Access to story/asset is saved on the redux store under the keyword access which holds keys as story asset id and the access returned from the API as its value
649
+
* `subscriptions` is the key in the store under which all the subscription groups created for the specified account are maintained
650
+
* `paymentOptions` is the key under the store which has all the payment options created for the current AT account
651
+
* `selectedPlan` used by `initRazorPayPayment` refers to one of the plan object nested within the subscription groups
0 commit comments