open-index/open-npm huggingface dataset:
npm package: @orsetra/shared-auth
Description: Shared authentication utilities for Orsetra platform using Zitadel
Latest version: 1.1.8

# @orsetra/shared-auth

Shared authentication utilities for Orsetra platform using Zitadel OIDC.

## Installation

```bash
npm install @orsetra/shared-auth
# or
pnpm add @orsetra/shared-auth
```

## Peer Dependencies

```bash
npm install react react-dom next oidc-client-ts jose
```

## Usage

### 1. Configuration Zitadel

```typescript
import { createAuthConfig } from '@orsetra/shared-auth/config'

const authConfig = createAuthConfig({
  authority: process.env.NEXT_PUBLIC_ZITADEL_AUTHORITY,
  client_id: process.env.NEXT_PUBLIC_ZITADEL_CLIENT_ID,
  project_resource_id: process.env.NEXT_PUBLIC_ZITADEL_PROJECT_ID,
})
```

### 2. Provider dans l'App Principale

```tsx
import { ZitadelProvider } from '@orsetra/shared-auth'

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <ZitadelProvider config={authConfig}>
          {children}
        </ZitadelProvider>
      </body>
    </html>
  )
}
```

### 3. Protected Routes

```tsx
import { ProtectedRoute } from '@orsetra/shared-auth'

export default function DashboardPage() {
  return (
    <ProtectedRoute>
      <Dashboard />
    </ProtectedRoute>
  )
}
```

### 4. Utiliser le Service d'Auth

```typescript
import { ZitadelAuthService } from '@orsetra/shared-auth/services'

const authService = new ZitadelAuthService(authConfig)

// Login
await authService.login()

// Logout
await authService.logout()

// Get user
const user = await authService.getUser()

// Get access token
const token = await authService.getAccessToken()
```

## Architecture Micro-Frontend

### App Main (Authentification Centralisée)

L'app `main` gère le flow OAuth :

```tsx
// apps/main/app/layout.tsx
import { ZitadelProvider } from '@orsetra/shared-auth'

export default function RootLayout({ children }) {
  return (
    <ZitadelProvider config={authConfig}>
      {children}
    </ZitadelProvider>
  )
}
```

### Micro-Apps (Validation de Token)

Les micro-apps valident le token reçu :

```tsx
// apps/assets/middleware.ts
import { verifyToken } from '@orsetra/shared-auth/utils'

export async function middleware(request: NextRequest) {
  const token = request.headers.get('x-auth-token')
  
  if (!token) {
    return NextResponse.redirect('/login')
  }
  
  const isValid = await verifyToken(token)
  
  if (!isValid) {
    return NextResponse.redirect('/login')
  }
  
  return NextResponse.next()
}
```

## Environment Variables

```env
NEXT_PUBLIC_ZITADEL_AUTHORITY=https://your-instance.zitadel.cloud
NEXT_PUBLIC_ZITADEL_CLIENT_ID=your-client-id
NEXT_PUBLIC_ZITADEL_PROJECT_ID=your-project-id
```

## License

MIT

## Repository

[GitHub](https://github.com/orsetra/console-ui/tree/main/packages/shared-auth)
npm package: @orsetra/shared-config
Description: Shared configuration files for Orsetra platform
Latest version: 1.0.6

# @orsetra/shared-config

Shared configuration files for Orsetra platform projects.

## Installation

```bash
npm install @orsetra/shared-config
# or
pnpm add @orsetra/shared-config
# or
yarn add @orsetra/shared-config
```

## Peer Dependencies

```bash
npm install tailwindcss
```

## Usage

### Tailwind CSS Configuration

Extend the shared Tailwind configuration in your `tailwind.config.ts`:

```ts
import type { Config } from 'tailwindcss'
import sharedConfig from '@orsetra/shared-config/tailwind'

const config: Config = {
  ...sharedConfig,
  content: [
    './app/**/*.{js,ts,jsx,tsx,mdx}',
    './components/**/*.{js,ts,jsx,tsx,mdx}',
    './node_modules/@orsetra/shared-ui/**/*.{js,ts,jsx,tsx}',
  ],
}

export default config
```

### TypeScript Configuration

Extend the shared TypeScript configuration in your `tsconfig.json`:

```json
{
  "extends": "@orsetra/shared-config/typescript",
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./app/*"]
    }
  }
}
```

## What's Included

### Tailwind Configuration

- **Design tokens** - Colors, spacing, typography
- **Custom utilities** - Additional Tailwind utilities
- **Plugin configuration** - Pre-configured Tailwind plugins
- **Theme** - Consistent design system

### TypeScript Configuration

- **Strict mode** - Enabled for type safety
- **Module resolution** - Configured for modern bundlers
- **JSX support** - React JSX configuration
- **Path aliases** - Common path alias patterns

## Customization

You can override any configuration by spreading the shared config and adding your own settings:

```ts
import sharedConfig from '@orsetra/shared-config/tailwind'

export default {
  ...sharedConfig,
  theme: {
    ...sharedConfig.theme,
    extend: {
      ...sharedConfig.theme.extend,
      colors: {
        ...sharedConfig.theme.extend.colors,
        brand: '#your-color',
      },
    },
  },
}
```

## License

MIT

## Repository

[GitHub](https://github.com/orsetra/console-ui/tree/main/packages/shared-config)
npm package: @orsetra/shared-types
Description: Shared TypeScript types for Orsetra platform
Latest version: 1.0.4

# @orsetra/shared-types

Shared TypeScript type definitions for Orsetra platform.

## Installation

```bash
npm install @orsetra/shared-types
# or
pnpm add @orsetra/shared-types
# or
yarn add @orsetra/shared-types
```

## Usage

```typescript
import type { User, ApiResponse, PaginatedData } from '@orsetra/shared-types'

// Use the types in your code
const user: User = {
  id: '123',
  email: 'user@example.com',
  name: 'John Doe',
}

const response: ApiResponse<User> = {
  success: true,
  data: user,
}
```

## Available Types

### Common Types

- **User** - User entity type
- **ApiResponse<T>** - Generic API response wrapper
- **PaginatedData<T>** - Paginated data structure
- **ErrorResponse** - Error response structure

### Import Specific Types

```typescript
import type { User } from '@orsetra/shared-types/types/common'
```

## Type Safety

All types are strictly typed and provide full IntelliSense support in modern IDEs.

```typescript
import type { ApiResponse } from '@orsetra/shared-types'

function handleResponse(response: ApiResponse<User>) {
  if (response.success) {
    // TypeScript knows response.data is User
    console.log(response.data.email)
  } else {
    // TypeScript knows response.error exists
    console.error(response.error)
  }
}
```

## Extending Types

You can extend the shared types in your own projects:

```typescript
import type { User } from '@orsetra/shared-types'

interface ExtendedUser extends User {
  customField: string
}
```

## License

MIT

## Repository

[GitHub](https://github.com/orsetra/console-ui/tree/main/packages/shared-types)
npm package: @orsetra/shared-ui
Description: Shared UI components for Orsetra platform
Latest version: 1.5.11

# @orsetra/shared-ui

Shared UI components library for Orsetra platform, built with React, Radix UI, and Tailwind CSS.

## Installation

```bash
npm install @orsetra/shared-ui
# or
pnpm add @orsetra/shared-ui
# or
yarn add @orsetra/shared-ui
```

## Peer Dependencies

This package requires the following peer dependencies:

```bash
npm install react react-dom
```

## Usage

```tsx
import { Button } from '@orsetra/shared-ui'
import { cn } from '@orsetra/shared-ui/lib/utils'

function App() {
  return (
    <Button variant="default" size="lg">
      Click me
    </Button>
  )
}
```

## Components

This library includes pre-built components based on Radix UI:

- **Button** - Customizable button component
- **Dialog** - Modal dialog component
- **Dropdown Menu** - Dropdown menu component
- **Select** - Select input component
- **Tabs** - Tab navigation component
- **Toast** - Toast notification component
- **Tooltip** - Tooltip component
- And many more...

## Utilities

### `cn` - Class Name Utility

Merge Tailwind CSS classes with proper precedence:

```tsx
import { cn } from '@orsetra/shared-ui/lib/utils'

const className = cn('px-4 py-2', 'bg-blue-500', 'hover:bg-blue-600')
```

## Styling

This library uses Tailwind CSS. Make sure to configure your `tailwind.config.js`:

```js
import sharedConfig from '@orsetra/shared-config/tailwind'

export default {
  ...sharedConfig,
  content: [
    './app/**/*.{js,ts,jsx,tsx}',
    './node_modules/@orsetra/shared-ui/**/*.{js,ts,jsx,tsx}',
  ],
}
```

## License

MIT

## Repository

[GitHub](https://github.com/orsetra/console-ui/tree/main/packages/shared-ui)