Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arkitektio/arkitekt-ts
Meta Package for Arkitekt Typescript Clients
https://github.com/arkitektio/arkitekt-ts
arkitekt arkitekt-client javascript metapackage typescript
Last synced: about 1 month ago
JSON representation
Meta Package for Arkitekt Typescript Clients
- Host: GitHub
- URL: https://github.com/arkitektio/arkitekt-ts
- Owner: arkitektio
- Created: 2023-03-13T09:50:15.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-12T18:37:05.000Z (about 1 year ago)
- Last Synced: 2024-05-01T12:49:46.232Z (9 months ago)
- Topics: arkitekt, arkitekt-client, javascript, metapackage, typescript
- Language: TypeScript
- Homepage: https://arkitekt.live
- Size: 330 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Arkitekt Typescript Client
This repository contains the Code for the Arkitekt Typescript client,
which provides convenience methods to integrate Arkitekt into React-based
applications.## Installation
```bash
yarn add @jhnnsrs/arkitekt
```## Usage
```typescript
import { Route, BrowserRouter as Router, Routes } from "react-router-dom";
import "./App.css";
import { EasyGuard, EasyProvider, useApp } from "./arkitekt";
import { AutoConfiguration } from "./arkitekt/autos/AutoConfiguration";
import { Callback } from "./arkitekt/components/Callback";
import { useArkitektConnect } from "./arkitekt/hooks/useArkitektConnect";
import { useArkitektLogin } from "./arkitekt/hooks/useArkitektLogin";export const Test = () => {
const { manifest } = useApp();
const { registeredEndpoints, load } = useArkitektConnect();
const { login } = useArkitektLogin();return (
<>
{manifest.identifier}
{registeredEndpoints.map((e) => {
return (
load({
endpoint: e,
})
}
>
Connect to {e.name}
);
})}
>
} // Endpoitns will be automatically autodiscoverd if local
notLoggedInFallback={
<>
login()}>Login
>
} // Will start the login workflow
> // Api calls to the Platform needs to be happening within a Guarded Connecs
Lets do something with this app
>
);
};function App() {
return (
} />
} />
);
}```
This is a basic Arkitekt App, which will be able to connnect to a local Arkitekt Service, retrieve configuration from it (or negotiate
to become a new app on the platform), and then authenticates the user via Oauth2 (using an oauth authorization-code grant).
Components within the "Easy Guard" will only be rendered once Arkitekt is connected.