When somebody uses a feature of your product, you’re going to need to record this usage so that Kana can understand what and how much of a feature that a user has used.
client
variable.id
in Kana for both Objects.
If neither the user nor feature exist yet in Kana, then you should create these first:
Create Users
Create Features
We will work on the assumption that you have pulled the following user and have all the following details to hand:
userId
- the id
of the User
featureId
- the id
if the Feature
delta
- the amount of the feature that’s been used as an Integer.
id
arguments to be String’s - as this matches the id
scalar type on the User object and Feature object respectively. If any other field type is used, an error will occur telling you we can’t accept any field type except String.true
if the usage event was successful. Feel free to use the response you get back to log the call, or raise any errors/retry the call if the request is not successful or returns false
in the response.