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

# Exports

Use Striga Core in your own scripts. One API on every framework.

{% hint style="success" %}
**Quick start**

```lua
local Core = exports['striga-core']:GetCore()
local cash = Core.getMoney('cash')            -- client
local bank = Core.getMoney(source, 'bank')    -- server
```

{% endhint %}

## Get the core

Add `dependency 'striga-core'` to your `fxmanifest.lua`, then on client or server:

```lua
local Core = exports['striga-core']:GetCore()

-- striga-core restarted: old function refs are dead, get them again
AddEventHandler('onResourceStart', function(res)
    if res == 'striga-core' then Core = exports['striga-core']:GetCore() end
end)

-- core is ready (systems picked), fires once
AddEventHandler('striga-core:ready', function()
    print('framework:', Core.framework())
end)
```

{% hint style="warning" %}

* Call with a **dot**: `Core.getMoney('cash')`, not `Core:getMoney`.
* Before core is ready, functions return `nil` (some return a safe value like `false` or `{}`). Errors never reach your script: core logs once and returns `nil`.
* Every call crosses resources. **Do not call `Core.*` every frame.** Listen to the [events](/docs/striga-core/events.md) and keep the value.
  {% endhint %}

Accounts: `cash`, `bank`, `black` (ESX black money). Notify types: `info`, `success`, `warning`, `error`.

## All exports

| Export                               | Side   | What it does                                                                                    |
| ------------------------------------ | ------ | ----------------------------------------------------------------------------------------------- |
| `GetCore()`                          | both   | The API table (see the pages below)                                                             |
| `GetVersion()`                       | both   | `version, apiVersion`                                                                           |
| `RegisterAdapter(kind, name, impl)`  | both   | Plug in your own system. Returns `ok, err`. See [Integration](/docs/striga-core/integration.md) |
| `InventoryChanged()`                 | client | Your custom inventory tells core the items changed                                              |
| `InventoryOpen(true/false)`          | client | Your custom inventory tells core it opened / closed                                             |
| `InventoryChanged(src)`              | server | The active inventory resource reports a change for a player                                     |
| `ItemUsed(src, name, item?)`         | server | The active inventory resource reports an item use                                               |
| `GetSuiteVersions()`                 | server | Versions of core and every installed Striga script                                              |
| `RegisterSettings(schema, handlers)` | client | Add your script to the settings hub                                                             |
| `UnregisterSettings(id?)`            | client | Remove your settings                                                                            |
| `GetSettingsProviders()`             | client | All registered settings with their values                                                       |
| `SetProviderSettings(id, patch)`     | client | Change settings of one provider                                                                 |
| `PreviewProvider(id, on)`            | client | Turn a provider's preview on / off                                                              |
| `ResetProvider(id)`                  | client | Reset a provider to its defaults                                                                |
| `NotifySettingsChanged(id?)`         | client | Your own panel changed your values                                                              |
| `SetTheme(theme)`                    | client | Publish the suite theme                                                                         |
| `GetTheme()`                         | client | `theme, publisher`                                                                              |
| `GetLocale()`                        | both   | Active language code, e.g. `'tr'`                                                               |
| `LocaleText(key, params?, code?)`    | both   | Text from the `game` part of your `editable/locales/<code>.json`                                |
| `LocaleUi(path, code?)`              | both   | Text or table from the `ui` part (`'settings.title'`)                                           |
| `LocaleFiles(code?)`                 | both   | `localeRaw, fallbackRaw` (raw JSON of `<code>.json` and `en.json`) for your NUI                 |
| `GetLocales()`                       | both   | Codes that exist for your resource                                                              |
| `SetLocale(code)`                    | server | Change the server language live (not saved)                                                     |

{% hint style="info" %}
The server `InventoryChanged` / `ItemUsed` exports only work for the resource of the active inventory adapter. Settings and theme exports are explained on [Settings Hub & Theme](/docs/striga-core/settings-hub-and-theme.md).
{% endhint %}

{% content-ref url="/pages/XfBMXl1yAd2E5NtAdPg1" %}
[Server Exports](/docs/striga-core/exports/server-exports.md)
{% endcontent-ref %}

{% content-ref url="/pages/h3GHrnMxz5MNy4sOwDR6" %}
[Client Exports](/docs/striga-core/exports/client-exports.md)
{% endcontent-ref %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://striga.gitbook.io/docs/striga-core/exports.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
