Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { type PluginListenerHandle } from "@capacitor/core";

export interface MetaMapParams {
clientId: string
flowId: string
metadata?: object
}
export interface MetaMapCapacitorPlugin {
addListener(eventName: 'verificationCreated', listenerFunc: (data: { identityId: string, verificationID: string }) => any): Promise<PluginListenerHandle>;
showMetaMapFlow(options: MetaMapParams): Promise<{ identityId: string, verificationID: string }>;
}

3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { MetaMapParams } from './definitions';
const MetaMapCapacitorUnwrapped = registerPlugin<MetaMapCapacitorPlugin>('MetaMapCapacitor', {});

const MetaMapCapacitor = {
addEventListener: MetaMapCapacitorUnwrapped.addListener,
showMetaMapFlow: function(options: MetaMapParams):Promise<{ identityId: string, verificationID: string }> {
const { metadata } = options
return MetaMapCapacitorUnwrapped.showMetaMapFlow({...options, metadata: {...metadata, sdkType: "capacitor" }})
Expand All @@ -15,4 +16,4 @@ const MetaMapCapacitor = {

export * from './definitions';
export { MetaMapCapacitor };