---
title: "next/script strategies"
description: "Learn how to use different strategies for next/script."
url: "https://vercel.com/templates/next.js/script-component-strategies"
links:
  repository: "https://github.com/vercel/examples/tree/main/solutions/script-component-strategies"
  demo: "https://solutions-script-component-strategies.vercel.app"
  deploy: "https://vercel.com/new/clone?demo-title=next%2Fscript+strategies&demo-description=Learn+how+to+use+different+strategies+for+next%2Fscript.&demo-url=https%3A%2F%2Fsolutions-script-component-strategies.vercel.app&project-name=script-component-strategies&repository-name=script-component-strategies&repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fexamples%2Ftree%2Fmain%2Fsolutions%2Fscript-component-strategies&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F6beswAUXlVbv1OH0pcKrG%2Fedf4dca94e6ad51ed66878fc058ea4c6%2Fsolutions-script-component-strategies.vercel.app_.png"
---

# next/script strategies

Learn how to use different strategies for next/script.

This example shows how to use different strategies for next/script.

## Demo

https://solutions-script-component-strategies.vercel.app

## How to Use

You can choose from one of the following two methods to use this repository:

### Clone and Deploy

Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:

```bash
npx create-next-app --example https://github.com/vercel/examples/tree/main/solutions/script-component-strategies script-component-strategies
# or
yarn create next-app --example https://github.com/vercel/examples/tree/main/solutions/script-component-strategies script-component-strategies
```

Next, run Next.js in development mode:

```bash
npm install
npm run dev

# or

yarn
yarn dev
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=edge-middleware-eap) ([Documentation](https://nextjs.org/docs/deployment)).

## Related Templates

### [Loading Ads with the Script Component](https://vercel.com/templates/next.js/script-component-ad)

Learn to lazy load ads using the Next.js Script Component.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
