Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arkw/admin

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arkw/admin

## Initialize CLI

  • 0.1.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Admin Console

Initialize CLI

  1. npx @arkw init or pnpx @arkw init
  2. When prompted, supply the necessary credentials:

Configure Next.js project

next.config.mjs

Update nextConfig with esmExternals: 'loose'

const nextConfig = {
  experimental: {
      esmExternals: 'loose',
  }
}

export default nextConfig;

Setup framework-utils

framework-utils.ts

import { createFramework } from ‘@arkw/core’
import { config } from ‘arkw.config.ts // update path accordingly

export const framework = createFramework(config)

How to wire a connect button

GoogleConnectButton.tsx

import { framework } from ‘./framework-utils’; // update path accordingly

const GoogleConnectButton = () => {
  const OAuthConnectionRoute = framework?.makeConnectURI({
    name: 'Google' // Integration name
    referenceId: ‘user-1’, // This is most likely your userID
    clientRedirectPath: "/", // Where you want to redirect to after successful connection.
  });

  return (
      <a href={OAuthConnectionRoute}>Connect with Google</a>
  )
}

How to query synced data

Server component

import { framework } from ‘./framework-utils’; // update path accordingly

const recordData = await framework.getIntegration('GOOGLE)?.query({
     referenceId: `1`,
     entityType: 'CONTACTS',
     filters: {
       'data.email': {
         contains: 'mail',
       },
     },
     sort: ['asc(createdAt)', 'desc(updatedAt)'],
});

Execute an action

const res = await framework.executeAction({
      integrationName: 'GOOGLE',
      action: 'SEND_EMAIL',
      payload: {
        data: {
          to: emails,
          subject,
          body,
        },
        ctx: {
          referenceId: 'user-1',
        },
      },
});

FAQs

Package last updated on 05 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc