> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Daily.wrap()

> Creates a DailyCall instance that controls an existing iframe element you provide.

`Daily.wrap(iframe, { properties })`

<Badge color="green">{"✓"} Prebuilt</Badge> <Badge color="red">{"✗"} Custom</Badge>

Creates a [`DailyCall`](/reference/daily-js/daily-call-client) instance that controls an `iframe` element you already have in the DOM. Use `wrap()` instead of [`createFrame()`](/reference/daily-js/factory-methods/create-frame) when you need full control over the `iframe` element itself — its attributes, placement, or lifecycle.

<Warning>
  Your `iframe` element must have the `allow` attribute set to `"microphone; camera; autoplay; display-capture"` for camera, microphone, and screen sharing to work.
</Warning>

<Note>
  The `iframeStyle` property cannot be passed to `wrap()`. Apply styles directly to your `iframe` element, or use [`createFrame()`](/reference/daily-js/factory-methods/create-frame) if you want Daily to manage the `iframe` styles.
</Note>

## Parameters

<ParamField body="iframe" type="HTMLIFrameElement" required>
  The `iframe` DOM element to attach Daily to. Must have `allow="microphone; camera; autoplay; display-capture"` set.
</ParamField>

<ParamField body="properties" type="DailyCallOptions">
  Optional configuration. If `url` is not set here, it must be provided when calling [`join()`](/reference/daily-js/instance-methods/join) or [`load()`](/reference/daily-js/instance-methods/load). See [`DailyCallOptions`](/reference/daily-js/types/daily-call-options) for the full list of options.
</ParamField>

## Return value

Returns a new [`DailyCall`](/reference/daily-js/daily-call-client) instance.

## Example

```javascript theme={null}
const iframe = document.createElement('iframe');
iframe.setAttribute('allow', 'microphone; camera; autoplay; display-capture');
document.body.appendChild(iframe);

const call = Daily.wrap(iframe, {
  url: 'https://your-domain.daily.co/room-name',
});

await call.join();
```

<DuplicateCallObjectCallout api="daily-js" method="Daily.wrap()" />

## See also

<CardGroup>
  <Card title="Types" icon="t" iconType="solid">
    * [DailyCallOptions](/reference/daily-js/types/daily-call-options)
  </Card>

  <Card title="Methods" icon="code" iconType="solid">
    * [Daily.createFrame()](/reference/daily-js/factory-methods/create-frame)
    * [Daily.createCallObject()](/reference/daily-js/factory-methods/create-call-object)
    * [join()](/reference/daily-js/instance-methods/join)
    * [leave()](/reference/daily-js/instance-methods/leave)
  </Card>

  <Card title="Guides" icon="book-open" iconType="solid">
    * [Call modes](/docs/daily-js/concepts/call-modes)
    * [Call configuration](/docs/daily-js/concepts/call-configuration)
  </Card>
</CardGroup>
