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

# Create a sandbox instance using Snippet Id

> Create a new sandbox with same file system as previous sandbox.

The `fromSnippet()` method allows you to create a new sandbox with same file system as previous sandbox using its unique snippet ID. This is useful when you’ve created a sandbox with `shouldBackupFilesystem: true` and want to resume work without losing files or progress.

## `fromSnippet(playgroundSnippetId)`

**Description:**
Creates a new sandbox with same file system as previous sandbox using its snippet ID.

**Parameters:**

| Parameter           | Type   | Required | Description                                             |
| ------------------- | ------ | -------- | ------------------------------------------------------- |
| playgroundSnippetId | string | Yes      | The snippet ID returned from a previous `create()` call |

**Returns:**
`Promise<void>` - Resolves when connection is established

**Example:**

```typescript theme={null}
// Session 1: Create persistent sandbox
const snippetId = await sandbox1.create({
  shouldBackupFilesystem: true
})
await sandbox1.writeFile({ path: '/home/damner/data.txt', content: 'saved' })
await sandbox1.disconnect()

// Session 2: Create a new sandbox with same file system as previous sandbox
const sandbox2 = new Sandbox({ apiKey: 'key' })
await sandbox2.fromSnippet(snippetId)
const file = await sandbox2.getFile('/home/damner/data.txt')
console.log(await file.text()) // 'saved'
```

***
