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
| uri |`string`||✓| Uri to the manifest of a podlet |
1711
-
| name |`string`||✓| Name of the component. This is used to reference the component in your application, and does not have to match the name of the component itself |
1712
-
| retries |`number`|`4`|| The number of times the client should retry to settle a version number conflict before terminating. Overrides the `retries` option in the layout constructor |
1713
-
| timeout |`number`|`1000`|| Defines how long, in milliseconds, a request should wait before the connection is terminated. Overrides the `timeout` option in the layout constructor |
1714
-
| throwable |`boolean`|`false`|| Defines whether an error should be thrown if a failure occurs during the process of fetching a podlet. [See Fallbacks](/docs/guides/fallbacks). |
1715
-
| resolveJs |`boolean`|`false`|| Defines whether to resolve relative URIs to absolute URIs for JavaScript assets |
1716
-
| resolveCss |`boolean`|`false`|| Defines whether to resolve relative URIs to absolute URIs for CSS assets |
| uri |`string`||✓| Uri to the manifest of a podlet |
1711
+
| name |`string`||✓| Name of the component. This is used to reference the component in your application, and does not have to match the name of the component itself |
1712
+
| retries |`number`|`4`|| The number of times the client should retry to settle a version number conflict before terminating. Overrides the `retries` option in the layout constructor |
1713
+
| timeout |`number`|`1000`|| Defines how long, in milliseconds, a request should wait before the connection is terminated. Overrides the `timeout` option in the layout constructor |
1714
+
| throwable |`boolean`|`false`|| Defines whether an error should be thrown if a failure occurs during the process of fetching a podlet. [See Fallbacks](/docs/guides/fallbacks). |
1715
+
| excludeBy |`object`||| Lets you define a set of rules where a `fetch` call will not be resolved if it matches. |
1716
+
| includeBy |`object`||| Inverse of `excludeBy`. Setting both at the same time will throw. |
1717
+
1718
+
##### `excludeBy` and `includeBy`
1719
+
1720
+
These options are used by `fetch` to conditionally skip fetching the podlet content based on values on the request. It's an alternative to conditionally fetching podlets in your request handler. Setting both at the same time will throw.
1721
+
1722
+
Example: exclude a header and footer in a hybrid web view.
1723
+
1724
+
```js
1725
+
importClientfrom"@podium/client";
1726
+
constclient=newClient();
1727
+
1728
+
constfooter=client.register({
1729
+
uri:"http://footer.site.com/manifest.json",
1730
+
name:"footer",
1731
+
excludeBy: {
1732
+
deviceType: ["hybrid-ios", "hybrid-android"], // when footer.fetch(incoming) is called, if the incoming request has the header `x-podium-device-type: hybrid-ios`, `fetch` will return an empty response.
0 commit comments