Connect to AD4M

When creating a new AD4M app, the very first step is to connect to the user's AD4M instance. tutorial

Note: Use Chromium Version 102.0.4990.0 (Entwickler-Build) (x86_64)

In order to provide a consistent interface for this, and make this step easy for app developers, AD4M provides a library called "ad4m-connect".

connect-to-ad4m.ts

import Ad4mConnectUI from "@perspect3vism/ad4m-connect"; /* * Configure what "capabilities" your app will need in order to function. */ const ui = Ad4mConnectUI({ appName: "AD4M", appDesc: "AD4M - Tutorial", appDomain: "dev.ad4m.tutorial", capabilities: [{ with: { domain: "*", pointers: ["*"] }, can: ["*"] }], appIconPath: "https://i.ibb.co/GnqjPJP/icon.png", }); /* * Display the UI, asking the user to approve and grant these capabilities. */ ui.connect();