@buildwithlayer/sdk
TypeScript icon, indicating that this package has built-in type declarations

0.10.0 • Public • Published

@buildwithlayer/sdk

Installation

npm

npm install @buildwithlayer/sdk

Yarn

yarn add @buildwithlayer/sdk

Typescript

@buildwithlayer/sdk is writting in TypeScript and provides type definitions for all of its public APIs.

Basic Usage

import { Widget } from '@buildwithlayer/sdk';

function App() {
  return (
    <div className="App">
      <Widget />
    </div>
  );
}

export default App;

Usage

import { Widget } from '@buildwithlayer/sdk';

function App() {
  const name = 'John Doe';
  const companyName = 'Acme Inc.';
  return (
    <div>
      <Widget
        // Optional title for the header
        title="Optional Title"
        // Optional function to render a logo in the header
        renderLogo={() => <p>Logo</p>}
        // Optional function to render a custom fab
        renderFab={(onClick) => (
          <button onClick={onClick}>Open Layer Assistant</button>
        )}
        // Optional string to override the default message in the chat
        defaultMessage={`Hey there ${name}! Thanks for choosing ${companyName}! Ask me anything at all, and I will do it!`}
        // Optional theme overrides
        themeOverrides={{
          palette: {
            primary: {
              main: '#000000',
            },
            secondary: {
              main: '#ffffff',
            },
          },
        }}
      />
    </div>
  );
}

export default App;

Readme

Keywords

none

Package Sidebar

Install

npm i @buildwithlayer/sdk

Weekly Downloads

0

Version

0.10.0

License

none

Unpacked Size

249 kB

Total Files

58

Last publish

Collaborators

  • buildwithlayer
  • lucasg-buildwithlayer