***

title: "DefaultSlugStrategy"
generated: true
---------------

<GenerationInfo sourceFile="packages/core/src/config/entity/default-slug-strategy.ts" sourceLine="25" packageName="@vendure/core" since="3.5.0" />

The default strategy for generating slugs. This strategy:

* Converts to lowercase
* Replaces spaces and special characters with hyphens
* Removes non-alphanumeric characters (except hyphens)
* Removes leading and trailing hyphens
* Collapses multiple hyphens into one

*Example*

```ts
const strategy = new DefaultSlugStrategy();
strategy.generate(ctx, { value: "Hello World!" }); // "hello-world"
strategy.generate(ctx, { value: "Café Français" }); // "cafe-francais"
strategy.generate(ctx, { value: "100% Natural" }); // "100-natural"
```

```ts title="Signature"
class DefaultSlugStrategy implements SlugStrategy {
    generate(ctx: RequestContext, params: SlugGenerateParams) => string;
}
```

* Implements: [`SlugStrategy`](/current/core/reference/typescript-api/configuration/slug-strategy#slugstrategy)

<div className="members-wrapper">

### generate

\<MemberInfo kind="method" type={`(ctx: <a href='/current/core/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, params: SlugGenerateParams) => string`}   />

</div>
