<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/proxy-in-typescript-ixgxpqfcv" -->

---
title: Proxy in TypeScript | daily.dev
description: Proxy is a design pattern in TypeScript that provides a substitute object for a real service object, allowing for additional behaviors without changing client...
canonical: https://daily.dev/posts/proxy-in-typescript-ixgxpqfcv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Proxy in TypeScript | daily.dev
og:description: Proxy is a design pattern in TypeScript that provides a substitute object for a real service object, allowing for additional behaviors without changing client...
og:url: https://daily.dev/posts/proxy-in-typescript-ixgxpqfcv
og:image: https://api.daily.dev/og/posts/IxgxpQFcV.png
og:image:alt: Proxy in TypeScript
og:image:width: 1200
og:image:height: 630
og:locale: en
---

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

# Proxy in TypeScript

**[Community Picks](https://daily.dev/sources/community)** · 3 min read · 133 upvotes · 3 comments

## Summary

Proxy is a design pattern in TypeScript that provides a substitute object for a real service object, allowing for additional behaviors without changing client code.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://refactoring.guru/design-patterns/proxy/typescript/example>

## Community discussion

Top comments from developers on daily.dev.

**@orcdev** · 2 upvotes

> Gotta say that 'Dive into Design Patterns' by Refactoring Guru is one of the best books I have read about software architecture!

**@outsideinn** · 1 upvotes

> I love it

**@tduyng** · 1 upvotes

> In the real world, we can utilize Proxy to create a mock of the global Date object. It's a very clean solution.

---

Tags: [#typescript](https://daily.dev/tags/typescript), [#design-patterns](https://daily.dev/tags/design-patterns)

[View this post on daily.dev](https://daily.dev/posts/proxy-in-typescript-ixgxpqfcv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Proxy in TypeScript","url":"https://daily.dev/posts/proxy-in-typescript-ixgxpqfcv","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/proxy-in-typescript-ixgxpqfcv"},"datePublished":"2024-01-13T08:29:48.500Z","dateModified":"2024-01-13T08:29:46.812Z","description":"Proxy is a design pattern in TypeScript that provides a substitute object for a real service object, allowing for additional behaviors without changing client...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d0c80ca1e1aca1dc3e111eba86dc3b53?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d0c80ca1e1aca1dc3e111eba86dc3b53?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Community Picks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Community Picks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1655817725/logos/community","url":"https://daily.dev/sources/community"},"commentCount":3,"discussionUrl":"https://daily.dev/posts/proxy-in-typescript-ixgxpqfcv","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":133},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"keywords":"typescript,design-patterns","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Community Picks","item":"https://daily.dev/sources/community"},{"@type":"ListItem","position":3,"name":"Proxy in TypeScript"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/proxy-in-typescript-ixgxpqfcv","comment":[{"@type":"Comment","text":"Gotta say that ‘Dive into Design Patterns’ by Refactoring Guru is one of the best books I have read about software architecture!","datePublished":"2024-02-05T13:58:02.101Z","url":"https://daily.dev/posts/IxgxpQFcV#c-vWeR3rgfT","author":{"@type":"Person","name":"OrcDev","url":"https://daily.dev/orcdev","image":"https://avatars.githubusercontent.com/u/7549148?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"I love it","datePublished":"2024-02-27T05:58:56.132Z","url":"https://daily.dev/posts/IxgxpQFcV#c-CCBFJyAkn","author":{"@type":"Person","name":"Peter Oluwadamilola Michael","url":"https://daily.dev/outsideinn","image":"https://lh3.googleusercontent.com/a/ACg8ocJbxbNtFko_r4Zl_hYnYzs80QtXraE08hwCifJBqToG=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"In the real world, we can utilize Proxy to create a mock of the global Date object. It’s a very clean solution.","datePublished":"2024-04-03T07:39:32.998Z","url":"https://daily.dev/posts/IxgxpQFcV#c-EU3ACsL6N","author":{"@type":"Person","name":"Duy NG","url":"https://daily.dev/tduyng","image":"https://media.daily.dev/image/upload/s--xIWAx9aG--/f_auto/v1714769772/avatars/avatar_16N4qQxN6GlbZsfoiQbfR"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

