-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new moesif policy docs * oops, fixed * updated sidebar and typo * fixed link
- Loading branch information
Showing
6 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
By default, Zuplo will read the `request.user.sub` property and assign this as | ||
the moesif `user_id` attribute when sending to Moesif. However, this and the | ||
following attributes can be overriden in a | ||
[custom code policy](/docs/policies/custom-code-inbound). | ||
|
||
- `api_version` | ||
- `company_id` | ||
- `session_token` | ||
- `user_id` | ||
- `metadata` | ||
|
||
Here is some example code that shows how to override two of these attributes | ||
|
||
```ts | ||
setMoesifContext(context, { | ||
userId: "user-1234", | ||
metadata: { | ||
some: "arbitrary", | ||
meta: "data", | ||
}, | ||
}); | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Moesif [moesif.com](https://moesif.com) is an API analytics and monetization | ||
platform. This policy allows you to measure (and meter) API calls flowing | ||
through your Zuplo gateway. | ||
|
||
Add the policy to each route you want to meter. Note you can specify the Meter | ||
API Name and Meter Value (meter increment) at the policy level. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema", | ||
"$id": "http://zuplo.com/schemas/policies/open-id-jwt-auth-inbound.json", | ||
"type": "object", | ||
"title": "Moesif Analytics & Billing", | ||
"isPreview": false, | ||
"description": "Moesif is an API analytics and billing service. This policy allows you to send metering calls for each API to their events batch endpoint.", | ||
"required": ["handler"], | ||
"properties": { | ||
"handler": { | ||
"type": "object", | ||
"default": {}, | ||
"required": ["export", "module", "options"], | ||
"properties": { | ||
"export": { | ||
"const": "MoesifInboundPolicy", | ||
"description": "The name of the exported type" | ||
}, | ||
"module": { | ||
"const": "$import(@zuplo/runtime)", | ||
"description": "The module containing the policy" | ||
}, | ||
"options": { | ||
"type": "object", | ||
"description": "The options for this policy. Many of them can be overridden at the code level in a request using the `AmberfloMeteringPolicy.setRequestProperties` method.", | ||
"required": ["apiKey"], | ||
"properties": { | ||
"applicationId": { | ||
"type": "string", | ||
"description": "Your Moesif application ID (required)" | ||
}, | ||
"logRequestBody": { | ||
"type": "boolean", | ||
"description": "Set to false to disable sending the request body to Moesif (optional)" | ||
}, | ||
"logResponseBody": { | ||
"type": "boolean", | ||
"description": "Set to false to disable sending the response body to Moesif (optional)" | ||
} | ||
} | ||
} | ||
}, | ||
"examples": [ | ||
{ | ||
"_name": "basic", | ||
"module": "$import(@zuplo/runtime)", | ||
"export": "AmberfloMeteringInboundPolicy", | ||
"options": { | ||
"applicationId": "YOUR_MOESIF_APPLICATION_ID", | ||
"logRequestBody": true, | ||
"logResponseBody": true | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
737b142
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./
docs.zuplosite.com
docs-git-main.zuplosite.com
docs-site.zuplosite.com
docs.zuplopreview.net