mirror of
https://github.com/AderKonstantin/aderktech-chronark.com-.git
synced 2025-06-08 05:38:41 +03:00
23 lines
44 KiB
JSON
23 lines
44 KiB
JSON
{
|
|
"published": true,
|
|
"title": "@upstash/ratelimit",
|
|
"description": "Ratelimiting library for serverless and edge runtimes. Built on top of Upstash Redis.",
|
|
"date": "2022-06-06T00:00:00.000Z",
|
|
"url": "https://upstash.com/ratelimit",
|
|
"repository": "upstash/ratelimit",
|
|
"body": {
|
|
"raw": "\nIn today's digital age, serverless computing has become increasingly popular due to its scalability and cost-efficiency. One of the challenges of serverless computing is to manage resources efficiently, and one critical aspect of this is rate limiting. Rate limiting is a technique that limits the number of requests a client can make to a server over a given period. This technique can prevent abuse, improve performance, and reduce costs. One npm package that helps implement rate limiting for serverless applications is @upstash/ratelimit, built on top of Upstash Redis.\n\nUpstash is a managed Redis-compatible database service designed for serverless applications.\n\n`@upstash/ratelimit` is an npm package that provides serverless rate limiting using Upstash Redis. The package offers a simple API that can be used to limit the number of requests a client can make within a given time frame. The following algorithms are supported:\n\n- Fixed window\n- Sliding window\n- Leaky bucket\n\n\nUsing `@upstash/ratelimit` is straightforward. First, you need to install the package using npm:\n\n```bash\nnpm install @upstash/ratelimit @upstash/redis\n```\nThen, you can use it in your application:\n\n```ts\nimport { Ratelimit } from \"@upstash/ratelimit\"\nimport { Redis } from \"@upstash/redis\"\n\nconst ratelimit = new Ratelimit({\n redis: new Redis({\n url: \"\",\n token: \"\"\n }),\n limiter: Ratelimit.slidingWindow(10, \"10s\"),\n analytics: true\n})\n\n\n// Check if the client has exceeded the rate limit\nconst { success } = await ratelimit.limit(\"identifier\")\n```\n\nIn the code above, we initialize Upstash with our Upstash Redis credentials and define our rate limiting rules. We then call the `limit` function, passing the identifier. The function returns a Promise that resolves with `success` and some other useful data.\n\n`@upstash/ratelimit` is a useful npm package for serverless rate limiting that simplifies the process of implementing rate limiting for serverless applications. The package is built on top of Upstash Redis, which provides a complete solution for serverless applications. With `@upstash/ratelimit`, serverless developers can easily implement rate limiting, which can help prevent abuse, improve performance, and reduce costs.",
|
|
"code": "var Component=(()=>{var ir=Object.create;var S=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var dr=Object.getPrototypeOf,mr=Object.prototype.hasOwnProperty;var z=(u,r)=>()=>(r||u((r={exports:{}}).exports,r),r.exports),hr=(u,r)=>{for(var p in r)S(u,p,{get:r[p],enumerable:!0})},ke=(u,r,p,g)=>{if(r&&typeof r==\"object\"||typeof r==\"function\")for(let y of ur(r))!mr.call(u,y)&&y!==p&&S(u,y,{get:()=>r[y],enumerable:!(g=lr(r,y))||g.enumerable});return u};var fr=(u,r,p)=>(p=u!=null?ir(dr(u)):{},ke(r||!u||!u.__esModule?S(p,\"default\",{value:u,enumerable:!0}):p,u)),br=u=>ke(S({},\"__esModule\",{value:!0}),u);var ve=z((kr,xe)=>{xe.exports=React});var Ee=z(G=>{\"use strict\";(function(){\"use strict\";var u=ve(),r=Symbol.for(\"react.element\"),p=Symbol.for(\"react.portal\"),g=Symbol.for(\"react.fragment\"),y=Symbol.for(\"react.strict_mode\"),X=Symbol.for(\"react.profiler\"),K=Symbol.for(\"react.provider\"),H=Symbol.for(\"react.context\"),R=Symbol.for(\"react.forward_ref\"),D=Symbol.for(\"react.suspense\"),A=Symbol.for(\"react.suspense_list\"),F=Symbol.for(\"react.memo\"),B=Symbol.for(\"react.lazy\"),Fe=Symbol.for(\"react.offscreen\"),J=Symbol.iterator,Te=\"@@iterator\";function we(e){if(e===null||typeof e!=\"object\")return null;var a=J&&e[J]||e[Te];return typeof a==\"function\"?a:null}var x=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var a=arguments.length,t=new Array(a>1?a-1:0),c=1;c<a;c++)t[c-1]=arguments[c];Ce(\"error\",e,t)}}function Ce(e,a,t){{var c=x.ReactDebugCurrentFrame,i=c.getStackAddendum();i!==\"\"&&(a+=\"%s\",t=t.concat([i]));var l=t.map(function(s){return String(s)});l.unshift(\"Warning: \"+a),Function.prototype.apply.call(console[e],console,l)}}var Oe=!1,Pe=!1,Se=!1,De=!1,Ae=!1,Z;Z=Symbol.for(\"react.module.reference\");function Be(e){return!!(typeof e==\"string\"||typeof e==\"function\"||e===g||e===X||Ae||e===y||e===D||e===A||De||e===Fe||Oe||Pe||Se||typeof e==\"object\"&&e!==null&&(e.$$typeof===B||e.$$typeof===F||e.$$typeof===K||e.$$typeof===H||e.$$typeof===R||e.$$typeof===Z||e.getModuleId!==void 0))}function Ie(e,a,t){var c=e.displayName;if(c)return c;var i=a.displayName||a.name||\"\";return i!==\"\"?t+\"(\"+i+\")\":t}function Q(e){return e.displayName||\"Context\"}function _(e){if(e==null)return null;if(typeof e.tag==\"number\"&&h(\"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"),typeof e==\"function\")return e.displayName||e.name||null;if(typeof e==\"string\")return e;switch(e){case g:return\"Fragment\";case p:return\"Portal\";case X:return\"Profiler\";case y:return\"StrictMode\";case D:return\"Suspense\";case A:return\"SuspenseList\"}if(typeof e==\"object\")switch(e.$$typeof){case H:var a=e;return Q(a)+\".Consumer\";case K:var t=e;return Q(t._context)+\".Provider\";case R:return Ie(e,e.render,\"ForwardRef\");case F:var c=e.displayName||null;return c!==null?c:_(e.type)||\"Memo\";case B:{var i=e,l=i._payload,s=i._init;try{return _(s(l))}catch{return null}}}return null}var k=Object.assign,j=0,ee,re,ne,ae,te,ce,oe;function se(){}se.__reactDisabledLog=!0;function We(){{if(j===0){ee=console.log,re=console.info,ne=console.warn,ae=console.error,te=console.group,ce=console.groupCollapsed,oe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}j++}}function Ye(){{if(j--,j===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:ee}),info:k({},e,{value:re}),warn:k({},e,{value:ne}),error:k({},e,{value:ae}),group:k({},e,{value:te}),groupCollapsed:k({},e,{value:ce}),groupEnd:k({},e,{value:oe})})}j<0&&h(\"disabledDepth fell below zero. This is a bug in React. Please file an issue.\")}}var I=x.ReactCurrentDispatcher,W;function T(e,a,t){{if(W===void 0)try{throw Error()}catch(i){var c=i.stack.trim().match(/\\n( *(at )?)/);W=c&&c[1]||\"\"}return`\n`+W+e}}var Y=!1,w;{var $e=typeof WeakMap==\"function\"?WeakMap:Map;w=new $e}function ie(e,a){if(!e||Y)return\"\";{var t=w.get(e);if(t!==void 0)return t}var c;Y=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var l;l=I.current,I.current=null,We();try{if(a){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==\"object\"&&Reflect.construct){try{Reflect.construct(s,[])}catch(N){c=N}Reflect.construct(e,[],s)}else{try{s.call()}catch(N){c=N}e.call(s.prototype)}}else{try{throw Error()}catch(N){c=N}e()}}catch(N){if(N&&c&&typeof N.stack==\"string\"){for(var o=N.stack.split(`\n`),f=c.stack.split(`\n`),d=o.length-1,m=f.length-1;d>=1&&m>=0&&o[d]!==f[m];)m--;for(;d>=1&&m>=0;d--,m--)if(o[d]!==f[m]){if(d!==1||m!==1)do if(d--,m--,m<0||o[d]!==f[m]){var b=`\n`+o[d].replace(\" at new \",\" at \");return e.displayName&&b.includes(\"<anonymous>\")&&(b=b.replace(\"<anonymous>\",e.displayName)),typeof e==\"function\"&&w.set(e,b),b}while(d>=1&&m>=0);break}}}finally{Y=!1,I.current=l,Ye(),Error.prepareStackTrace=i}var E=e?e.displayName||e.name:\"\",ge=E?T(E):\"\";return typeof e==\"function\"&&w.set(e,ge),ge}function Me(e,a,t){return ie(e,!1)}function Ve(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function C(e,a,t){if(e==null)return\"\";if(typeof e==\"function\")return ie(e,Ve(e));if(typeof e==\"string\")return T(e);switch(e){case D:return T(\"Suspense\");case A:return T(\"SuspenseList\")}if(typeof e==\"object\")switch(e.$$typeof){case R:return Me(e.render);case F:return C(e.type,a,t);case B:{var c=e,i=c._payload,l=c._init;try{return C(l(i),a,t)}catch{}}}return\"\"}var O=Object.prototype.hasOwnProperty,le={},ue=x.ReactDebugCurrentFrame;function P(e){if(e){var a=e._owner,t=C(e.type,e._source,a?a.type:null);ue.setExtraStackFrame(t)}else ue.setExtraStackFrame(null)}function Le(e,a,t,c,i){{var l=Function.call.bind(O);for(var s in e)if(l(e,s)){var o=void 0;try{if(typeof e[s]!=\"function\"){var f=Error((c||\"React class\")+\": \"+t+\" type `\"+s+\"` is invalid; it must be a function, usually from the `prop-types` package, but received `\"+typeof e[s]+\"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.\");throw f.name=\"Invariant Violation\",f}o=e[s](a,s,c,t,null,\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\")}catch(d){o=d}o&&!(o instanceof Error)&&(P(i),h(\"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).\",c||\"React class\",t,s,typeof o),P(null)),o instanceof Error&&!(o.message in le)&&(le[o.message]=!0,P(i),h(\"Failed %s type: %s\",t,o.message),P(null))}}}var qe=Array.isArray;function $(e){return qe(e)}function ze(e){{var a=typeof Symbol==\"function\"&&Symbol.toStringTag,t=a&&e[Symbol.toStringTag]||e.constructor.name||\"Object\";return t}}function Ge(e){try{return de(e),!1}catch{return!0}}function de(e){return\"\"+e}function me(e){if(Ge(e))return h(\"The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.\",ze(e)),de(e)}var U=x.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},he,fe,M;M={};function Ke(e){if(O.call(e,\"ref\")){var a=Object.getOwnPropertyDescriptor(e,\"ref\").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function He(e){if(O.call(e,\"key\")){var a=Object.getOwnPropertyDescriptor(e,\"key\").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function Je(e,a){if(typeof e.ref==\"string\"&&U.current&&a&&U.current.stateNode!==a){var t=_(U.current.type);M[t]||(h('Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',_(U.current.type),e.ref),M[t]=!0)}}function Ze(e,a){{var t=function(){he||(he=!0,h(\"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",a))};t.isReactWarning=!0,Object.defineProperty(e,\"key\",{get:t,configurable:!0})}}function Qe(e,a){{var t=function(){fe||(fe=!0,h(\"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",a))};t.isReactWarning=!0,Object.defineProperty(e,\"ref\",{get:t,configurable:!0})}}var er=function(e,a,t,c,i,l,s){var o={$$typeof:r,type:e,key:a,ref:t,props:s,_owner:l};return o._store={},Object.defineProperty(o._store,\"validated\",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,\"_self\",{configurable:!1,enumerable:!1,writable:!1,value:c}),Object.defineProperty(o,\"_source\",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function rr(e,a,t,c,i){{var l,s={},o=null,f=null;t!==void 0&&(me(t),o=\"\"+t),He(a)&&(me(a.key),o=\"\"+a.key),Ke(a)&&(f=a.ref,Je(a,i));for(l in a)O.call(a,l)&&!Xe.hasOwnProperty(l)&&(s[l]=a[l]);if(e&&e.defaultProps){var d=e.defaultProps;for(l in d)s[l]===void 0&&(s[l]=d[l])}if(o||f){var m=typeof e==\"function\"?e.displayName||e.name||\"Unknown\":e;o&&Ze(s,m),f&&Qe(s,m)}return er(e,o,f,i,c,U.current,s)}}var V=x.ReactCurrentOwner,be=x.ReactDebugCurrentFrame;function v(e){if(e){var a=e._owner,t=C(e.type,e._source,a?a.type:null);be.setExtraStackFrame(t)}else be.setExtraStackFrame(null)}var L;L=!1;function q(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===r}function pe(){{if(V.current){var e=_(V.current.type);if(e)return`\n\nCheck the render method of \\``+e+\"`.\"}return\"\"}}function nr(e){{if(e!==void 0){var a=e.fileName.replace(/^.*[\\\\\\/]/,\"\"),t=e.lineNumber;return`\n\nCheck your code at `+a+\":\"+t+\".\"}return\"\"}}var _e={};function ar(e){{var a=pe();if(!a){var t=typeof e==\"string\"?e:e.displayName||e.name;t&&(a=`\n\nCheck the top-level render call using <`+t+\">.\")}return a}}function Ne(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ar(a);if(_e[t])return;_e[t]=!0;var c=\"\";e&&e._owner&&e._owner!==V.current&&(c=\" It was passed a child from \"+_(e._owner.type)+\".\"),v(e),h('Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,c),v(null)}}function ye(e,a){{if(typeof e!=\"object\")return;if($(e))for(var t=0;t<e.length;t++){var c=e[t];q(c)&&Ne(c,a)}else if(q(e))e._store&&(e._store.validated=!0);else if(e){var i=we(e);if(typeof i==\"function\"&&i!==e.entries)for(var l=i.call(e),s;!(s=l.next()).done;)q(s.value)&&Ne(s.value,a)}}}function tr(e){{var a=e.type;if(a==null||typeof a==\"string\")return;var t;if(typeof a==\"function\")t=a.propTypes;else if(typeof a==\"object\"&&(a.$$typeof===R||a.$$typeof===F))t=a.propTypes;else return;if(t){var c=_(a);Le(t,e.props,\"prop\",c,e)}else if(a.PropTypes!==void 0&&!L){L=!0;var i=_(a);h(\"Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?\",i||\"Unknown\")}typeof a.getDefaultProps==\"function\"&&!a.getDefaultProps.isReactClassApproved&&h(\"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.\")}}function cr(e){{for(var a=Object.keys(e.props),t=0;t<a.length;t++){var c=a[t];if(c!==\"children\"&&c!==\"key\"){v(e),h(\"Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.\",c),v(null);break}}e.ref!==null&&(v(e),h(\"Invalid attribute `ref` supplied to `React.Fragment`.\"),v(null))}}function or(e,a,t,c,i,l){{var s=Be(e);if(!s){var o=\"\";(e===void 0||typeof e==\"object\"&&e!==null&&Object.keys(e).length===0)&&(o+=\" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.\");var f=nr(i);f?o+=f:o+=pe();var d;e===null?d=\"null\":$(e)?d=\"array\":e!==void 0&&e.$$typeof===r?(d=\"<\"+(_(e.type)||\"Unknown\")+\" />\",o=\" Did you accidentally export a JSX literal instead of a component?\"):d=typeof e,h(\"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",d,o)}var m=rr(e,a,t,i,l);if(m==null)return m;if(s){var b=a.children;if(b!==void 0)if(c)if($(b)){for(var E=0;E<b.length;E++)ye(b[E],e);Object.freeze&&Object.freeze(b)}else h(\"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\");else ye(b,e)}return e===g?cr(m):tr(m),m}}var sr=or;G.Fragment=g,G.jsxDEV=sr})()});var Ue=z((vr,je)=>{\"use strict\";je.exports=Ee()});var yr={};hr(yr,{default:()=>Nr,frontmatter:()=>pr});var n=fr(Ue()),pr={title:\"@upstash/ratelimit\",description:\"Ratelimiting library for serverless and edge runtimes. Built on top of Upstash Redis.\",date:\"2022-06-06\",url:\"https://upstash.com/ratelimit\",repository:\"upstash/ratelimit\",published:!0};function Re(u){let r=Object.assign({p:\"p\",code:\"code\",ul:\"ul\",li:\"li\",div:\"div\",pre:\"pre\",span:\"span\"},u.components);return(0,n.jsxDEV)(n.Fragment,{children:[(0,n.jsxDEV)(r.p,{children:\"In today's digital age, serverless computing has become increasingly popular due to its scalability and cost-efficiency. One of the challenges of serverless computing is to manage resources efficiently, and one critical aspect of this is rate limiting. Rate limiting is a technique that limits the number of requests a client can make to a server over a given period. This technique can prevent abuse, improve performance, and reduce costs. One npm package that helps implement rate limiting for serverless applications is @upstash/ratelimit, built on top of Upstash Redis.\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:11,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.p,{children:\"Upstash is a managed Redis-compatible database service designed for serverless applications.\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:13,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.p,{children:[(0,n.jsxDEV)(r.code,{children:\"@upstash/ratelimit\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:1},this),\" is an npm package that provides serverless rate limiting using Upstash Redis. The package offers a simple API that can be used to limit the number of requests a client can make within a given time frame. The following algorithms are supported:\"]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.ul,{children:[`\n`,(0,n.jsxDEV)(r.li,{children:\"Fixed window\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:17,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.li,{children:\"Sliding window\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:18,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.li,{children:\"Leaky bucket\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:19,columnNumber:1},this),`\n`]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:17,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.p,{children:[\"Using \",(0,n.jsxDEV)(r.code,{children:\"@upstash/ratelimit\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:22,columnNumber:7},this),\" is straightforward. First, you need to install the package using npm:\"]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:22,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,n.jsxDEV)(r.pre,{\"data-language\":\"bash\",\"data-theme\":\"default\",children:(0,n.jsxDEV)(r.code,{\"data-language\":\"bash\",\"data-theme\":\"default\",children:(0,n.jsxDEV)(r.span,{className:\"line\",children:[(0,n.jsxDEV)(r.span,{style:{color:\"#B392F0\"},children:\"npm\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:104},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:143},this),(0,n.jsxDEV)(r.span,{style:{color:\"#9ECBFF\"},children:\"install\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:180},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:223},this),(0,n.jsxDEV)(r.span,{style:{color:\"#9ECBFF\"},children:\"@upstash/ratelimit\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:260},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:314},this),(0,n.jsxDEV)(r.span,{style:{color:\"#9ECBFF\"},children:\"@upstash/redis\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:351},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:85},this)},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:79},this)},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:1},this)},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:24,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.p,{children:\"Then, you can use it in your application:\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:27,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,n.jsxDEV)(r.pre,{\"data-language\":\"ts\",\"data-theme\":\"default\",children:(0,n.jsxDEV)(r.code,{\"data-language\":\"ts\",\"data-theme\":\"default\",children:[(0,n.jsxDEV)(r.span,{className:\"line\",children:[(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"import\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:104},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" { Ratelimit } \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:146},this),(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"from\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:197},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:237},this),(0,n.jsxDEV)(r.span,{style:{color:\"#9ECBFF\"},children:'\"@upstash/ratelimit\"'},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:274},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:85},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:[(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"import\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:2,columnNumber:20},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" { Redis } \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:2,columnNumber:62},this),(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"from\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:2,columnNumber:109},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:2,columnNumber:149},this),(0,n.jsxDEV)(r.span,{style:{color:\"#9ECBFF\"},children:'\"@upstash/redis\"'},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:2,columnNumber:186},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:2,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:3,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:[(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"const\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:20},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:61},this),(0,n.jsxDEV)(r.span,{style:{color:\"#79B8FF\"},children:\"ratelimit\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:98},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:143},this),(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"=\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:180},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:217},this),(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"new\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:254},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:293},this),(0,n.jsxDEV)(r.span,{style:{color:\"#B392F0\"},children:\"Ratelimit\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:330},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\"({\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:375},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:4,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:[(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" redis: \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:5,columnNumber:20},this),(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"new\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:5,columnNumber:67},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:5,columnNumber:106},this),(0,n.jsxDEV)(r.span,{style:{color:\"#B392F0\"},children:\"Redis\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:5,columnNumber:143},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\"({\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:5,columnNumber:184},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:5,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:[(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" url: \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:6,columnNumber:20},this),(0,n.jsxDEV)(r.span,{style:{color:\"#9ECBFF\"},children:'\"\"'},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:6,columnNumber:69},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\",\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:6,columnNumber:117},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:6,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:[(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" token: \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:7,columnNumber:20},this),(0,n.jsxDEV)(r.span,{style:{color:\"#9ECBFF\"},children:'\"\"'},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:7,columnNumber:71},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:7,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" }),\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:8,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:8,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:[(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" limiter: Ratelimit.\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:9,columnNumber:20},this),(0,n.jsxDEV)(r.span,{style:{color:\"#B392F0\"},children:\"slidingWindow\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:9,columnNumber:79},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:9,columnNumber:128},this),(0,n.jsxDEV)(r.span,{style:{color:\"#79B8FF\"},children:\"10\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:9,columnNumber:165},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:9,columnNumber:203},this),(0,n.jsxDEV)(r.span,{style:{color:\"#9ECBFF\"},children:'\"10s\"'},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:9,columnNumber:241},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\"),\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:9,columnNumber:292},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:9,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:[(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" analytics: \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:10,columnNumber:20},this),(0,n.jsxDEV)(r.span,{style:{color:\"#79B8FF\"},children:\"true\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:10,columnNumber:71},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:10,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\"})\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:11,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:11,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:12,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:13,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:(0,n.jsxDEV)(r.span,{style:{color:\"#6A737D\"},children:\"// Check if the client has exceeded the rate limit\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:14,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:14,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.span,{className:\"line\",children:[(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"const\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:20},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" { \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:61},this),(0,n.jsxDEV)(r.span,{style:{color:\"#79B8FF\"},children:\"success\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:100},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" } \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:143},this),(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"=\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:182},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:219},this),(0,n.jsxDEV)(r.span,{style:{color:\"#F97583\"},children:\"await\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:256},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\" ratelimit.\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:297},this),(0,n.jsxDEV)(r.span,{style:{color:\"#B392F0\"},children:\"limit\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:344},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:385},this),(0,n.jsxDEV)(r.span,{style:{color:\"#9ECBFF\"},children:'\"identifier\"'},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:422},this),(0,n.jsxDEV)(r.span,{style:{color:\"#E1E4E8\"},children:\")\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:480},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:15,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:79},this)},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:1},this)},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:29,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.p,{children:[\"In the code above, we initialize Upstash with our Upstash Redis credentials and define our rate limiting rules. We then call the \",(0,n.jsxDEV)(r.code,{children:\"limit\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:47,columnNumber:130},this),\" function, passing the identifier. The function returns a Promise that resolves with \",(0,n.jsxDEV)(r.code,{children:\"success\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:47,columnNumber:222},this),\" and some other useful data.\"]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:47,columnNumber:1},this),`\n`,(0,n.jsxDEV)(r.p,{children:[(0,n.jsxDEV)(r.code,{children:\"@upstash/ratelimit\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:49,columnNumber:1},this),\" is a useful npm package for serverless rate limiting that simplifies the process of implementing rate limiting for serverless applications. The package is built on top of Upstash Redis, which provides a complete solution for serverless applications. With \",(0,n.jsxDEV)(r.code,{children:\"@upstash/ratelimit\"},void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:49,columnNumber:277},this),\", serverless developers can easily implement rate limiting, which can help prevent abuse, improve performance, and reduce costs.\"]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:49,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\",lineNumber:1,columnNumber:1},this)}function _r(u={}){let{wrapper:r}=u.components||{};return r?(0,n.jsxDEV)(r,Object.assign({},u,{children:(0,n.jsxDEV)(Re,u,void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\"},this)}),void 0,!1,{fileName:\"/Users/andreasthomas/github/chronark/chronark.com/content/projects/_mdx_bundler_entry_point-a6c12280-860e-43f1-8b4c-80ac401a77dc.mdx\"},this):Re(u)}var Nr=_r;return br(yr);})();\n/*! Bundled license information:\n\nreact/cjs/react-jsx-dev-runtime.development.js:\n (**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n*/\n;return Component;"
|
|
},
|
|
"_id": "projects/upstash-ratelimit.mdx",
|
|
"_raw": {
|
|
"sourceFilePath": "projects/upstash-ratelimit.mdx",
|
|
"sourceFileName": "upstash-ratelimit.mdx",
|
|
"sourceFileDir": "projects",
|
|
"contentType": "mdx",
|
|
"flattenedPath": "projects/upstash-ratelimit"
|
|
},
|
|
"type": "Project",
|
|
"path": "/projects/upstash-ratelimit",
|
|
"slug": "upstash-ratelimit"
|
|
} |