![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@manifoldco/manifold-init
Advanced tools
This web component is a hub for our other web components to use for things like managing authentication, making network calls, and reporting errors and analytics.
This exists for the benefit of our other web components, so that they don't each have to do the work of implementing more complex concerns that are shared by all components.
If you are using one of our web component libraries, you need manifold-init
. This component needs to be on the page for other components to use our GraphQL API. It accepts a client-id
attribute which tells us which provider or platform you are within our system.
At minimum, the component must be on the page with your client-id
. Using manifold-plan-table as an example:
<head>
<script
nomodule
src="https://js.cdn.manifold.co/@manifoldco/manifold-init/dist/manifold-init/manifold-init.js"
></script>
<script
nomodule
src="https://js.cdn.manifold.co/@manifoldco/manifold-plan-table/dist/manifold-plan-table/manifold-plan-table.js"
></script>
<script
async
type="module"
src="https://js.cdn.manifold.co/@manifoldco/manifold-init/dist/manifold-init/manifold-init.esm.js"
></script>
<script
async
type="module"
src="https://js.cdn.manifold.co/@manifoldco/manifold-plan-table/dist/manifold-plan-table/manifold-plan-table.esm.js"
></script>
<script async type="module" src="/build/manifold-plan-table.esm.js"></script>
</head>
<body>
<manifold-init client-id="your-client-id"></manifold-init>
<manifold-plan-table product-id="your-product-id"></manifold-plan-table>
</body>
Some of our components require your users to be authenticated in order to access their private data from our GraphQL API. You can retrieve a user authentication token using the createProfileAuthToken mutation. Once you have the auth token, you can pass it into the manifold-init
component as the auth-token
attribute. This token will then be included in all GraphQL requests to identify the user to our API.
<manifold-init client-id="your-client-id" auth-token="user-auth-token"></manifold-init>
The manifold-init
component exposes a connection object that web components can use to perform GraphQL requests and analytics tracking. You access this object by querying for the node as soon as manifold-init
is defined in the custom elements registry:
await customElements.whenDefined('manifold-init');
const core = document.querySelector('manifold-init') as HTMLManifoldInitElement;
this.connection = await core.initialize({
element: this.el,
componentVersion: '<@NPM_PACKAGE_VERSION@>',
version: 0,
});
If you're using TypeScript in your component library, you'll need access to some type definitions.
The definition for the Connection
object is found in its own library, @manifoldco/manifold-init-types.
import { Connection } from '@manifoldco/manifold-init-types/types/v0';
This library supports multiple versions of the Connection
object in order to avoid breaking changes for web components. The above example shows v0 being used.
This is the type definition for the manifold-init
element itself, and it also lives in @manifoldco/manifold-init-types. This can be exposed globally in your project in a type declaration file:
// global.d.ts
export * from '@manifoldco/manifold-init-types/types/components';
FAQs
Manifold UI Initialization
The npm package @manifoldco/manifold-init receives a total of 2 weekly downloads. As such, @manifoldco/manifold-init popularity was classified as not popular.
We found that @manifoldco/manifold-init demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.