0.1.1 • Published 12 months ago

@adityasinghal26/daytona-web v0.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
12 months ago

@adityasinghal26/daytona-web

This package was created through the Backstage CLI.

Description

The plugin provides the frontend components required for Daytona Authentication (daytonaApiFactory) and Sign-In (daytonaSignInProvider). These components will ease the implementation for Daytona authentication using OAuth in Backstage.

Installation

Install the package via Yarn in your Backstage root directory:

# From your Backstage root directory
yarn --cwd packages/app add @adityasinghal26/daytona-web

Authentication Setup

Backstage requires ApiFactory to interact with Daytona OAuth library and a sign-in provider. Follow the below steps:

  1. In Backstage folder packages/app/src, add the below snippet in apis.ts file.

    // In packages/app/src/apis.ts
    import { daytonaApiFactory } from '@adityasinghal26/daytona-web';
    
    // Add the Daytona ApiFactory to the list of available APIs
    export const apis: AnyApiFactory[] = [
        {/* other ApiFactory here */}
        daytonaApiFactory
    ];
  2. Add the following to Backstage App.tsx file.

    // In packages/app/src/App.tsx
    import { daytonaSignInProvider } from '@adityasinghal26/daytona-web';
    
    // Add the Daytona Sign-In Provider to the available sign-in providers
    const app = createApp({
        {/* other api, bind routes here */}
        components: {
            SignInPage: props => <SignInPage {...props} auto providers={['guest',daytonaSignInProvider]} />,
        },
    });