Ruby
Changelog
Every release of the gem, newest first.
0.0.1
The first release of the Ruby gem. It has a method for every one of the 684 methods of the TypeScript SDK, in 53 namespaces, each under its TypeScript name in snake_case, and a parity check in the gem’s own build proves that every one sends byte for byte the request its TypeScript twin sends.
Nextmail::Clienthas a reader for every namespace, fromemails,threadsandtemplatestoautomations,bookingsandconnected_mailboxes. A request body goes in as keyword arguments or as one Hash whose keys keep the API’s camelCase names, and a response comes back as a Hash with Symbol keys.- A client takes
api_key:oraccess_token:, andaccess_token:also takes anything that responds tocalland returns a token, called before every request, so a token renews without a new client.base_url:,timeout:,max_retries:,headers:,user_agent:andadapter:set the rest, and every method takesapi_key:, orinbox_token:ontemp_mail, to act with another credential for one call. Nextmail.create_clientbuilds a client fromNEXTMAIL_API_KEY,NEXTMAIL_ACCESS_TOKENandNEXTMAIL_BASE_URL, andNextmail.init,Nextmail.clientandNextmail.reset_clientmanage one shared client thatNextmail.emailsand every other namespace reach through.Nextmail.create_temp_mailopens disposable inboxes with no credential.- Every paginated resource has
list, which returns oneNextmail::Pagewithitems,has_more?andnext_cursor,list_all, which returns every item as an Array, anditerate, which yields each item to a block or returns an Enumerator that fetches the next page only when it gets there. - An API refusal raises
Nextmail::ApiErroror its subclass for the error type, such asNotFoundError,ValidationErrororRateLimitError, withstatus,type,code,param,doc_url,request_id,retry_after_secondsandfields, and predicates such asvalidation?,step_up_required?andretryable?. No response at all raisesNextmail::NetworkError, withtimeout?when the deadline passed, and a mistake in the call itself raisesArgumentErrorbefore anything is sent. - Reads, sends and every write that is safe to repeat are retried on 408, 500, 502, 503 and 504 with backoff, and on a 429 only when its
Retry-Afteris a minute or less. A send carries an idempotency key that its retries reuse, so a retry never sends a second message.timeout:bounds a whole attempt, and uploads wait at least ten minutes. Nextmail.verify_webhook_signaturechecks a delivery in constant time, refuses one more than five minutes old and returns the parsed event. It reads the signature from a Hash in any case, a Rack env or Rails’request.headers.- The helpers of the TypeScript SDK are here too, such as
Nextmail.to_base64andNextmail.resolve_language, and every value set it exports is a frozen Hash onNextmail, such asNextmail::WEBHOOK_EVENTSandNextmail::API_SCOPES. - The gem has no runtime dependencies. Requests go through Net::HTTP with a pool of kept-alive connections that one client shares across threads and rebuilds after a fork, and
HTTPS_PROXYandNO_PROXYare honoured.client.raw.requestreaches any endpoint with the client’s credential and retries, and a credential is never sent over plainhttp:to anything but this machine. - When a newer version is on RubyGems, the client says so once, on a terminal only.
disable_update_notice: trueorNEXTMAIL_DISABLE_UPDATE_NOTICE=1turns that off. - It needs Ruby 3.2 or newer.
Google Workspace