1.0.63 • Published 1 year ago

vitra-auth-npm-pack v1.0.63

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Translate Website (Web Translator)

A website translation sdk from Vitra.ai

Logo

Installation

Install with npm

  npm i vitra-auth-npm-pack

Usage/Examples

Import css file in _app.tsx

import 'vitra-web-translator/dist/esm/styles/index.css';
import type { AppProps } from 'next/app';

export default function App({ Component, pageProps }: AppProps) {
  return (
    <>
      <Component {...pageProps} />
    </>
  );
}

Create a Common Component

import React, { FC, ReactNode } from 'react';
import { VitraWebTranslator } from 'vitra-web-translator';

type Props = {
  children: ReactNode,
};

const Layout: FC<Props> = ({ children }) => {
  return (
    <VitraWebTranslator
      apiKey="vitra.VjopflOAtjF9coT7U3_*********_*"
      glossaryId="*************"
      position="center-right"
      theme="dark"
    >
      {children}
    </VitraWebTranslator>
  );
};

export default Layout;

Use the common component anywhere in your app

import React from 'react';
import Layout from './Layout';

const Demo = () => {
  return (
    <Layout>
      <h1>This is a demo component</h1>
    </Layout>
  );
};

export default Demo;

Props

PropTypeRequiredDescriptionPossible ValuesDefault
apiKeystringYesAPI Key generated from Vitra Web Translator siteAPI KEYnull
glossaryIdstringYesGlossary Id generated from Vitra Web Translator siteGLOSSARY IDnull
themestringYesTheme of the language selector'dark' | 'blue' | 'pink' | 'yellow'dark
positionstringYesPosition of the language selector dropdown if it is floating'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center-center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right''center-right'

Support

For support, email support@vitra.ai.

1.0.49

1 year ago

1.0.62

1 year ago

1.0.51

1 year ago

1.0.61

1 year ago

1.0.50

1 year ago

1.0.60

1 year ago

1.0.55

1 year ago

1.0.54

1 year ago

1.0.53

1 year ago

1.0.63

1 year ago

1.0.52

1 year ago

1.0.59

1 year ago

1.0.58

1 year ago

1.0.47

1 year ago

1.0.57

1 year ago

1.0.56

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago