# InjectResource

## Syntax

```lua
Susano.InjectResource(resourceName, luaCode) -> void
```

## Parameters

{% hint style="info" %}
`resourceName` (string): Target resource identifier. Use "any" to inject in the first available resource.

`luaCode` (string): Lua source to execute inside that resource.
{% endhint %}

## Return(s)

{% hint style="info" %}
None
{% endhint %}

## Behavior

{% hint style="info" %}
Requires exactly two string arguments; otherwise raises a Lua error.

Code runs in the target resource’s environment, not Susano’s sandbox.

Susano API is unavailable inside injected code (not isolated). Do not call `Susano.*` there.

Use the resource’s own globals and natives. Namespaces and upvalues differ from Susano.
{% endhint %}

## Example(s)

```lua
-- inject a simple logger into resource "gamemode"
Susano.InjectResource("gamemode", [[
  print("[inject] gamemode init hook installed")
  -- Susano.* calls will NOT work here
]])

-- inject code that overrides a function in the target resource
Susano.InjectResource("ui_resource", [[
  local old = _G.ShowNotification
  _G.ShowNotification = function(msg)
    return old("[INJECTED] "..tostring(msg))
  end
]])

-- inject into the first available resource
Susano.InjectResource("any", [[
  print("[inject] any init hook installed")
  -- Susano.* calls will NOT work here
]])
```
