> For the complete documentation index, see [llms.txt](https://exelord.gitbook.io/wazapp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://exelord.gitbook.io/wazapp/packages/core.md).

# @wazapp/core

The core is the main element of Wazapp application. It delivers `<App />` component which creates app's `Owner`. It use used to keep all your singleton instances, eg. `Services`.

## API

### App

The App component will integrate your app with Wazapp. Make sure to wrap your top level component with it.

Optionally, you can pass your own `Owner` instance to it, using `owner` property.

#### Example

```typescript
import { App as Wazapp } from '@wazapp/core'

const MyApp = () => (
  <Wazapp>
    <IndexPage />
  </Wazapp>
)

export default MyApp;
```

### Owner

The owner serves as a global registry for your application. It exposes two methods: `lookup` and `register`. Usually, you dont need to worry about them but may become hand if you would like to pre initialize your own service.

Owner is used by `@wazapp/component` to access and lazy instantiate services.

#### Methods

* `register(key: any, value: any)` - register "memorize" any valye you want under whatever key you want
* `lookup(key: any)` - withdraw the "memorized" value for specific key

#### Example

```typescript
class MySingleton {
  constructor(options) {
    this.options = options;
  }
}

owner.register(MySingleton, new MySingleton({ hey: 'wazapp' }));

const mySingletonInstance = owner.lookup(MySingleton);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://exelord.gitbook.io/wazapp/packages/core.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
